Commit graph

11 commits

Author SHA1 Message Date
Izalia Mae 6c71f895d8 update extension loader path 2021-05-26 00:36:41 -04:00
Izalia Mae 2f572e384d make build.sh executable 2021-04-29 13:09:26 -04:00
Izalia Mae b2dc81f566 add build script and fix for python 3.8+ 2021-04-28 19:48:32 -04:00
Adrian Perez de Castro ec83c18d19
Workaround to ensure GVariant values are properly wrapped
Long story short: a GVariant must be wrapped into a gi.Struct subclass,
and PyGObject uses _pygi_struct_new_from_g_type() for that, but unfortunately
it is a private function (also, it uses other private functions, so copying
it code into pythonloader.c is not an option). Wading through the PyGObject
code it turns out that we can wrap the GVariant into a GValue, and instead use
pyg_value_as_pyobject(): it ends up calling _pygi_struct_new_from_g_type()
(via pygi_value_to_py_structured_type(), which is also private) for GValues
which wrap a GVariant.

This fixes issue #3
2016-08-11 15:55:48 +03:00
Adrian Perez de Castro 6e6d6e594d
Connect to load-failed and load-changed to provide some feedback 2016-08-04 19:58:45 +03:00
Adrian Perez de Castro e458d31e4d
Cleanup code and ensure gi.require_version() is called
Newer versions of PyGObject warn about not using gi.require_version() before
importing a module using gi.repository.<Module>. The added code performs a
call equivalent to:

  gi.require_version("WebKit2WebExtension", "4.0")

before importing "gi.repository.WebKit2WebExtension" into the Python VM.

Also, this patch moves all the boilerplate which checks Python errors into
a PY_CHECK() macro, which makes the code easier to follow.

This tentatively fixes issue #3.
2016-08-04 16:34:27 +03:00
Adrian Perez 60777acf26 Merge pull request #2 from nathan-hoad/master
Initialize sys.argv so that it's at least available.
2016-03-23 12:50:52 +02:00
Nathan Hoad 0a953ecba4 Fix passing arbitrary user data to the Python extension
Closes issue #1
2016-03-23 12:44:39 +02:00
Nathan Hoad 3afcf5314d Initialize sys.argv so that it's at least available.
Lots of code is written with the (reasonable) assumption that sys.argv
will be there, gi.overrides.Gtk is an example of such code.
2016-01-30 15:54:02 +11:00
Adrian Perez de Castro 824391644f Add README file 2015-08-25 19:24:08 +03:00
Adrian Perez de Castro f180885d41 Initial import 2015-08-25 19:05:14 +03:00