def onModuleEncounter(self, module_filename, module_name, module_kind): # Make sure if module_name.isBelowNamespace("webview.platforms"): if isWin32Windows(): result = module_name in ( "webview.platforms.winforms", "webview.platforms.edgechromium", "webview.platforms.edgehtml", "webview.platforms.mshtml", "webview.platforms.cef", ) reason = "Platforms package of webview used on '%s'." % getOS() elif isMacOS(): result = module_name == "webview.platforms.cocoa" reason = "Platforms package of webview used on '%s'." % getOS() elif getActiveQtPlugin() is not None: result = module_name = "webview.platforms.qt" reason = ("Platforms package of webview used due to '%s'." % getActiveQtPlugin()) else: result = module_name = "webview.platforms.gtk" reason = ( "Platforms package of webview used on '%s' without Qt plugin enabled." % getOS()) return result, reason
def onModuleEncounter(self, module_filename, module_name, module_kind): if module_name.hasNamespace("mpl_toolkits"): return True, "Needed by matplotlib" # some special handling for matplotlib: # depending on whether 'tk-inter' resp. 'qt-plugins' are enabled, # their matplotlib backends are included. if hasActivePlugin("tk-inter"): if module_name in ( "matplotlib.backends.backend_tk", "matplotlib.backends.backend_tkagg", "matplotlib.backend.tkagg", ): return True, "Needed for tkinter matplotplib backend" if getActiveQtPlugin() is not None: # Note, their code tries everything behind that name, the qt5 is # misleading therefore, PySide will work there too. if module_name in ( "matplotlib.backends.backend_qt5", "matplotlib.backends.backend_qt5.py", "matplotlib.backends.backend_qt5cairo.py", "matplotlib.backend.backend_qt5.py", ): return True, "Needed for Qt matplotplib backend" if module_name == "matplotlib.backends.backend_agg": return True, "Needed as standard matplotplib backend"
def __init__(self, qt_plugins, no_qt_translations): self.qt_plugins = OrderedSet(x.strip().lower() for x in qt_plugins.split(",")) self.no_qt_translations = no_qt_translations self.webengine_done_binaries = False self.webengine_done_data = False self.qt_plugins_dirs = None self.binding_package_name = ModuleName(self.binding_name) # Allow to specify none. if self.qt_plugins == set(["none"]): self.qt_plugins = set() # Prevent the list of binding names from being incomplete, it's used for conflicts. assert self.binding_name in _qt_binding_names, self.binding_name # Also lets have consistency in naming. assert self.plugin_name in getQtPluginNames() active_qt_plugin_name = getActiveQtPlugin() if active_qt_plugin_name is not None: self.sysexit( "Error, confliciting plugin '%s', you can only have one enabled." % active_qt_plugin_name) self.warned_about = set()