def setSocialiteVars(locals): # setting SociaLite specific variables locals[Preprocess.getSocialiteModule()] = SociaLite locals["socialite"] = SociaLite for k in SociaLite.__all__: locals[k] = getattr(SociaLite, k) return;
def load_module(self, fullname): path = fullname.split('.') path[-1] += '.py' filename = os.path.join(self.__path, *path) module = sys.modules.get(fullname) if not module: src = Preprocess.run(open(filename, 'rb').read()) module = imp.new_module(fullname) sys.modules[fullname] = module #module = sys.modules[fullname] = addMod(fullname) setSocialiteVars(module.__dict__) locals = module.__dict__ locals["__name__"] = fullname locals["__file__"] = filename if src[0]=='#': src = removeEncoding(src) exec src in module.__dict__ return module;
def compile(self, src): gen=Preprocess.run(src) return gen
def __init__(self): self.pythonVar = Suppress(dollar) + ident + ~FollowedBy((dot+ident) | lparen) self.pythonVar.setParseAction(self.onPythonVar) self.varNames = [] Preprocess.setSocialiteModule(getModuleVar()) Preprocess.setSubstFunc(self.processPythonVars)
def __init__(self): self._pythonVar = None self.varNames = [] Preprocess.setSocialiteModule(getModuleVar())
def compile(self, src): gen = Preprocess.run(src) return gen