68 lines
2.5 KiB
Diff
68 lines
2.5 KiB
Diff
--- a/eolie/application.py
|
|
+++ b/eolie/application.py
|
|
@@ -12,8 +12,8 @@
|
|
|
|
import gi
|
|
gi.require_version('Gtk', '3.0')
|
|
-gi.require_version('WebKit2', '4.0')
|
|
-gi.require_version('Soup', '2.4')
|
|
+gi.require_version('WebKit2', '4.1')
|
|
+gi.require_version('Soup', '3.0')
|
|
gi.require_version('Secret', '1')
|
|
gi.require_version('GtkSpell', '3.0')
|
|
gi.require_version("Handy", "1")
|
|
--- a/eolie/css_stylesheet.py
|
|
+++ b/eolie/css_stylesheet.py
|
|
@@ -126,18 +126,12 @@ class StyleSheet(GObject.Object):
|
|
"""
|
|
try:
|
|
session = Soup.Session.new()
|
|
- request = session.request(uri)
|
|
- stream = request.send(self.__cancellable)
|
|
- bytes = bytearray(0)
|
|
- buf = stream.read_bytes(1024, self.__cancellable).get_data()
|
|
- while buf:
|
|
- bytes += buf
|
|
- buf = stream.read_bytes(1024, self.__cancellable).get_data()
|
|
- stream.close()
|
|
+ msg = Soup.Message.new("GET", uri)
|
|
+ content = session.send_and_read(msg, self.__cancellable)
|
|
try:
|
|
- return bytes.decode("utf-8")
|
|
+ return content.decode("utf-8")
|
|
except:
|
|
- return bytes.decode("iso8859-1")
|
|
+ return content.decode("iso8859-1")
|
|
except Exception as e:
|
|
Logger.error("StyleSheet::__get_uri_contents(): %s -> %s" %
|
|
(e, uri))
|
|
--- a/eolie/helper_task.py
|
|
+++ b/eolie/helper_task.py
|
|
@@ -11,7 +11,7 @@
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
import gi
|
|
-gi.require_version("Soup", "2.4")
|
|
+gi.require_version("Soup", "3.0")
|
|
from gi.repository import GLib, Soup
|
|
|
|
from threading import Thread
|
|
@@ -63,11 +63,13 @@ class TaskHelper:
|
|
"""
|
|
try:
|
|
session = Soup.Session.new()
|
|
- session.set_property("accept-language-auto", True)
|
|
+ session.set_accept_language_auto(True)
|
|
if self.__user_agent is not None:
|
|
- session.set_property("user-agent", self.__user_agent)
|
|
- request = session.request(uri)
|
|
- request.send_async(cancellable,
|
|
+ session.set_user_agent(self.__user_agent)
|
|
+ msg = Soup.Message.new("GET", uri)
|
|
+ session.send_async(msg,
|
|
+ GLib.PRIORITY_DEFAULT,
|
|
+ cancellable,
|
|
self.__on_request_send_async,
|
|
callback,
|
|
cancellable,
|