Beispiel #1
0
 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 dump
         dump(result)
     return result
Beispiel #2
0
    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 dump
                    dump(result.get_class(self))
                    dump(result)

                return result
            except IOError:
                # Continue trying different paths
                pass

        # The class could not be found.
        return None