Пример #1
0
 def __getattr__(self, name):
     try:
         return super(module, self).__getattribute__(name)
     except AttributeError as ae:
         try:
             clazz = findClass('{0}.{1}'.format(self.__name__, name))
             setattr(self, name, clazz)
             return clazz
         except Exception:
             # should raise AttributeError, not JepException
             raise ae
Пример #2
0
 def __getattr__(self, name):
     try:
         return super(module, self).__getattribute__(name)
     except AttributeError as ae:
         try:
             clazz = findClass('{0}.{1}'.format(self.__name__, name))
             setattr(self, name, clazz)
             return clazz
         except Exception:
             # should raise AttributeError, not JepException
             raise ae
Пример #3
0
    def load_module(self, fullname):
        if fullname in sys.modules:
            return sys.modules[fullname]

        mod = module(fullname)
        mod.__dict__.update({
            '__loader__': self,
            '__path__': [],
            '__file__': '<java>',
        })
        sys.modules[fullname] = mod

        # list of classes in package
        classlist = self.classlist.get(fullname)
        if classlist:
            for name in classlist:
                setattr(mod, name.split('.')[-1], findClass(name))
        return mod
Пример #4
0
    def load_module(self, fullname):
        if fullname in sys.modules:
            return sys.modules[fullname]

        mod = module(fullname)
        mod.__dict__.update({
            '__loader__': self,
            '__path__': [],
            '__file__': '<java>',
        })
        sys.modules[fullname] = mod

        # list of classes in package
        classlist = self.classlist.get(fullname)
        if classlist:
            for name in classlist:
                setattr(mod, name.split('.')[-1], findClass(name))
        return mod
Пример #5
0
 def __init__(self):
     self.classlist = findClass('jep.ClassList').getInstance()
Пример #6
0
 def __init__(self):
     self.classlist = findClass('jep.ClassList').getInstance()