diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:46:23 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-07-12 08:46:27 +0900 |
commit | 392945d666d2cfb31a844826a72b1eb65a52546f (patch) | |
tree | a21354051734cbace4e92d6b10c8fa8cd2721dda /pygtkcompat | |
parent | 4723e0bb24cc41607e5af3bb7036855fa767df0b (diff) | |
download | pygobject2-392945d666d2cfb31a844826a72b1eb65a52546f.tar.gz pygobject2-392945d666d2cfb31a844826a72b1eb65a52546f.tar.bz2 pygobject2-392945d666d2cfb31a844826a72b1eb65a52546f.zip |
Imported Upstream version 3.25.1
Change-Id: I31412b37aa390505e71295f3a2c2e3cf2ba88b41
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'pygtkcompat')
-rw-r--r-- | pygtkcompat/Makefile.in | 34 | ||||
-rw-r--r-- | pygtkcompat/pygtkcompat.py | 45 |
2 files changed, 70 insertions, 9 deletions
diff --git a/pygtkcompat/Makefile.in b/pygtkcompat/Makefile.in index 1603a25..94a31e5 100644 --- a/pygtkcompat/Makefile.in +++ b/pygtkcompat/Makefile.in @@ -89,10 +89,22 @@ build_triplet = @build@ host_triplet = @host@ subdir = pygtkcompat ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/as-ac-expand.m4 \ - $(top_srcdir)/m4/jhflags.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_append_compile_flags.m4 \ + $(top_srcdir)/m4/ax_append_flag.m4 \ + $(top_srcdir)/m4/ax_append_link_flags.m4 \ + $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/m4/ax_check_link_flag.m4 \ + $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_compiler_flags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_cflags.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_gir.m4 \ + $(top_srcdir)/m4/ax_compiler_flags_ldflags.m4 \ + $(top_srcdir)/m4/ax_is_release.m4 \ + $(top_srcdir)/m4/ax_require_defined.m4 \ + $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/introspection.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ $(top_srcdir)/m4/python.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) @@ -157,7 +169,6 @@ am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/py-compile DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ -ACLOCAL_AMFLAGS = @ACLOCAL_AMFLAGS@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ @@ -180,7 +191,6 @@ CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ -DATADIR = @DATADIR@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ @@ -213,8 +223,14 @@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@ INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@ +INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@ +INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@ +INTROSPECTION_LIBS = @INTROSPECTION_LIBS@ +INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ +INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ @@ -247,14 +263,12 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ -PLATFORM = @PLATFORM@ PYCAIRO_CFLAGS = @PYCAIRO_CFLAGS@ PYCAIRO_LIBS = @PYCAIRO_LIBS@ PYGOBJECT_MAJOR_VERSION = @PYGOBJECT_MAJOR_VERSION@ PYGOBJECT_MICRO_VERSION = @PYGOBJECT_MICRO_VERSION@ PYGOBJECT_MINOR_VERSION = @PYGOBJECT_MINOR_VERSION@ PYTHON = @PYTHON@ -PYTHON_BASENAME = @PYTHON_BASENAME@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_INCLUDES = @PYTHON_INCLUDES@ PYTHON_LIBS = @PYTHON_LIBS@ @@ -262,15 +276,17 @@ PYTHON_LIB_LOC = @PYTHON_LIB_LOC@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_SO = @PYTHON_SO@ +PYTHON_VALGRIND_SUPP = @PYTHON_VALGRIND_SUPP@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ -THREADING_CFLAGS = @THREADING_CFLAGS@ VERSION = @VERSION@ WARN_CFLAGS = @WARN_CFLAGS@ +WARN_LDFLAGS = @WARN_LDFLAGS@ +WARN_SCANNERFLAGS = @WARN_SCANNERFLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ diff --git a/pygtkcompat/pygtkcompat.py b/pygtkcompat/pygtkcompat.py index fd651f5..6884ef1 100644 --- a/pygtkcompat/pygtkcompat.py +++ b/pygtkcompat/pygtkcompat.py @@ -84,7 +84,28 @@ def _install_enums(module, dest=None, strip=''): continue +_enabled_registry = {} + + +def _check_enabled(name, version=None): + """Returns True in case it is already enabled""" + + if name in _enabled_registry: + enabled_version = _enabled_registry[name] + if enabled_version != version: + raise ValueError( + "%r already enabled with different version (%r)" % ( + name, enabled_version)) + return True + else: + _enabled_registry[name] = version + return False + + def enable(): + if _check_enabled(""): + return + # gobject from gi.repository import GLib sys.modules['glib'] = GLib @@ -104,6 +125,12 @@ _unset = object() def enable_gtk(version='3.0'): + if _check_enabled("gtk", version): + return + + if version == "4.0": + raise ValueError("version 4.0 not supported") + # set the default encoding like PyGTK reload(sys) if sys.version_info < (3, 0): @@ -499,12 +526,18 @@ def enable_gtk(version='3.0'): def enable_vte(): + if _check_enabled("vte"): + return + gi.require_version('Vte', '0.0') from gi.repository import Vte sys.modules['vte'] = Vte def enable_poppler(): + if _check_enabled("poppler"): + return + gi.require_version('Poppler', '0.18') from gi.repository import Poppler sys.modules['poppler'] = Poppler @@ -512,6 +545,9 @@ def enable_poppler(): def enable_webkit(version='1.0'): + if _check_enabled("webkit", version): + return + gi.require_version('WebKit', version) from gi.repository import WebKit sys.modules['webkit'] = WebKit @@ -519,12 +555,18 @@ def enable_webkit(version='1.0'): def enable_gudev(): + if _check_enabled("gudev"): + return + gi.require_version('GUdev', '1.0') from gi.repository import GUdev sys.modules['gudev'] = GUdev def enable_gst(): + if _check_enabled("gst"): + return + gi.require_version('Gst', '0.10') from gi.repository import Gst sys.modules['gst'] = Gst @@ -565,6 +607,9 @@ def enable_gst(): def enable_goocanvas(): + if _check_enabled("goocanvas"): + return + gi.require_version('GooCanvas', '2.0') from gi.repository import GooCanvas sys.modules['goocanvas'] = GooCanvas |