Make webactivity and webkit1 implementations independient
We can't import webkit and Webkit2 in the same process
and that was introduced in 4ea52b3173
Signed-off-by: Gonzalo Odiard <godiard@sugarlabs.org>
This commit is contained in:
parent
9e253b5965
commit
e47feb3b0f
@ -36,7 +36,7 @@ import mimetypes
|
|||||||
|
|
||||||
from gi.repository import SugarExt
|
from gi.repository import SugarExt
|
||||||
from sugar3.activity import activity
|
from sugar3.activity import activity
|
||||||
from sugar3.activity.webactivity import FilePicker
|
from sugar3.graphics.objectchooser import ObjectChooser
|
||||||
|
|
||||||
|
|
||||||
class LocalRequestHandler(BaseHTTPRequestHandler):
|
class LocalRequestHandler(BaseHTTPRequestHandler):
|
||||||
@ -98,6 +98,29 @@ class LocalHTTPServer(HTTPServer):
|
|||||||
self.server_port = port
|
self.server_port = port
|
||||||
|
|
||||||
|
|
||||||
|
class FilePicker(ObjectChooser):
|
||||||
|
def __init__(self, parent):
|
||||||
|
ObjectChooser.__init__(self, parent)
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
jobject = None
|
||||||
|
_file = None
|
||||||
|
try:
|
||||||
|
result = ObjectChooser.run(self)
|
||||||
|
if result == Gtk.ResponseType.ACCEPT:
|
||||||
|
jobject = self.get_selected_object()
|
||||||
|
logging.debug('FilePicker.run: %r', jobject)
|
||||||
|
|
||||||
|
if jobject and jobject.file_path:
|
||||||
|
_file = jobject.file_path
|
||||||
|
logging.debug('FilePicker.run: file=%r', _file)
|
||||||
|
finally:
|
||||||
|
if jobject is not None:
|
||||||
|
jobject.destroy()
|
||||||
|
|
||||||
|
return _file
|
||||||
|
|
||||||
|
|
||||||
class WebActivity(Gtk.Window):
|
class WebActivity(Gtk.Window):
|
||||||
def __init__(self, handle):
|
def __init__(self, handle):
|
||||||
Gtk.Window.__init__(self)
|
Gtk.Window.__init__(self)
|
||||||
|
Loading…
Reference in New Issue
Block a user