Esempio n. 1
0
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;
Esempio n. 2
0
    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;
Esempio n. 3
0
 def compile(self, src):
     gen=Preprocess.run(src)
     return gen
Esempio n. 4
0
 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)
Esempio n. 5
0
 def __init__(self):
     self._pythonVar = None
     self.varNames = []
     Preprocess.setSocialiteModule(getModuleVar())
Esempio n. 6
0
 def compile(self, src):
     gen = Preprocess.run(src)
     return gen
Esempio n. 7
0
 def __init__(self):
     self._pythonVar = None
     self.varNames = []
     Preprocess.setSocialiteModule(getModuleVar())