Skip to content

Commit

Permalink
Python Previewer: Initialize WebView
Browse files Browse the repository at this point in the history
  • Loading branch information
theCapypara committed Feb 9, 2024
1 parent cbe33d9 commit 79a083f
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/langs/python/python-previewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,28 @@
gi.require_version("Graphene", "1.0")
gi.require_version("Gsk", "4.0")
gi.require_version("GtkSource", "5")
gi.require_version("WebKit2", "6.0")
gi.require_version("Workbench", "0")

from gi.repository import GLib, Gdk, Gtk, Adw, Graphene, Gio, GtkSource, Workbench
from gi.repository import (
GObject,
GLib,
Gdk,
Gtk,
Adw,
Graphene,
Gio,
GtkSource,
WebKit,
Workbench,
)
from gi.repository.Gio import DBusConnection, DBusConnectionFlags

# Make sure all libraries are properly initialized
Gtk.init()
Adw.init()
GtkSource.init()
GObject.type_ensure(WebKit.WebView)

resource = Gio.Resource.load(
f'/app/share/{os.environ["FLATPAK_ID"]}/re.sonny.Workbench.libworkbench.gresource'
Expand Down

0 comments on commit 79a083f

Please sign in to comment.