예제 #1
0
파일: universe.py 프로젝트: Gabri3l/PySOM
 def load_shell_class(self, stmt):
     # Load the class from a stream and return the loaded class
     result = sourcecode_compiler.compile_class_from_string(stmt, None, self)
     if self._dump_bytecodes:
         from som.compiler.disassembler import Disassembler
         Disassembler.dump(result)
     return result
예제 #2
0
파일: universe.py 프로젝트: QDucasse/PySOM
 def load_shell_class(self, stmt):
     # Load the class from a stream and return the loaded class
     result = sourcecode_compiler.compile_class_from_string(
         stmt, None, self)
     if self._dump_bytecodes:
         from som.compiler.disassembler import Disassembler
         Disassembler.dump(result)
     return result
예제 #3
0
파일: universe.py 프로젝트: Gabri3l/PySOM
    def _load_class(self, name, system_class):
        # Try loading the class from all different paths
        for cpEntry in self._classpath:
            try:
                # Load the class from a file and return the loaded class
                result = sourcecode_compiler.compile_class_from_file(cpEntry, name.get_string(), system_class, self)
                if self._dump_bytecodes:
                    from som.compiler.disassembler import Disassembler
                    Disassembler.dump(result.get_class())
                    Disassembler.dump(result)

                return result
            except IOError:
                # Continue trying different paths
                pass

        # The class could not be found.
        return None
예제 #4
0
파일: universe.py 프로젝트: QDucasse/PySOM
    def _load_class(self, name, system_class):
        # Try loading the class from all different paths
        for cpEntry in self._classpath:
            try:
                # Load the class from a file and return the loaded class
                result = sourcecode_compiler.compile_class_from_file(
                    cpEntry, name.get_string(), system_class, self)
                if self._dump_bytecodes:
                    from som.compiler.disassembler import Disassembler
                    Disassembler.dump(result.get_class())
                    Disassembler.dump(result)

                return result
            except IOError:
                # Continue trying different paths
                pass

        # The class could not be found.
        return None