def _get_name (self, pip) : try : sys_path = list (sys.path) sys.path [0:0] = self.import_path m = TFL.import_module ("%s.Version" % pip.pkg) return m.Version.productid finally : sys.path = sys_path
def import_module (path) : fn = Filename (path) mn = fn.base md = fn.directory or "./" with TFL.Context.list_push (sys.path, md, 0) : result = TFL.import_module (mn) result.__App_Tests_Dir__ = md return result
def _setup_lic_comps(self): pns_name = self.productnick pkg_name = "_%s" % pns_name pkg = sys.modules.get(pkg_name) if pkg: pns = getattr(pkg, pns_name) try: lp_module = TFL.import_module("%s.Lic_Comps" % pkg_name) except ImportError: pass else: self.lic_comps.extend(getattr(lp_module, "list"))
def _setup_lic_comps (self) : pns_name = self.productnick pkg_name = "_%s" % pns_name pkg = sys.modules.get (pkg_name) if pkg : pns = getattr (pkg, pns_name) try : lp_module = TFL.import_module ("%s.Lic_Comps" % pkg_name) except ImportError : pass else : self.lic_comps.extend (getattr (lp_module, "list"))
def __init__ (self, name, application = None) : if application is not None : self._set_application (application) ( self.directory , self.module , plain_name ) = Plugin_Importer.new_plugin (name) pkg_name = "_Plugins._%s" % (plain_name, ) self.pns_name = plain_name self.plugin_pns = pns = getattr (self.module, plain_name) pns._Plugin = weakref.proxy (self) self.rank = getattr (self.module, "rank", 0) self._version = getattr \ (TFL.import_module ("%s.Version" % (pkg_name, )), "Version") if application is not None : application.load_images_from_dir (self.directory) self._add_documents ()
def __init__(self, db_man, module_name): LL_Class = TFL.import_module(module_name).Legacy_Lifter self.legacy_lifter = LL_Class(db_man)
def __init__ (self, db_man, module_name) : LL_Class = TFL.import_module (module_name).Legacy_Lifter self.legacy_lifter = LL_Class (db_man)