javaclass

Changeset

41:a33f6687721a
2004-11-13 Paul Boddie raw files shortlog changelog graph Fixed importing from the current directory. Changed the debug messages. Changed module creation.
classhook.py (file)
     1.1 --- a/classhook.py	Sat Nov 13 20:58:36 2004 +0100
     1.2 +++ b/classhook.py	Sat Nov 13 20:59:22 2004 +0100
     1.3 @@ -29,7 +29,7 @@
     1.4          from 'dir' and 'name' refers to a directory containing class files.
     1.5          """
     1.6  
     1.7 -        dir = dir or ""
     1.8 +        dir = dir or "."
     1.9  
    1.10          # Provide a special name for the current directory.
    1.11  
    1.12 @@ -38,7 +38,7 @@
    1.13          else:
    1.14              path = os.path.join(dir, name)
    1.15  
    1.16 -        print "*", name, dir, path
    1.17 +        print "Processing name", name, "in", dir, "producing", path
    1.18          if os.path.isdir(path):
    1.19              if len(glob.glob(os.path.join(path, "*" + os.extsep + "class"))) != 0:
    1.20                  return (None, path, ("", "", PKG_DIRECTORY))
    1.21 @@ -61,13 +61,13 @@
    1.22  
    1.23          global_names = {}
    1.24          global_names.update(__builtins__.__dict__)
    1.25 -        module = new.module(name)
    1.26 +        module = self.hooks.add_module(name)
    1.27  
    1.28          # Process each class file, producing a genuine Python class.
    1.29  
    1.30          class_files = []
    1.31          for class_filename in glob.glob(os.path.join(filename, "*" + os.extsep + "class")):
    1.32 -            print "*", class_filename
    1.33 +            print "Importing class", class_filename
    1.34              f = open(class_filename, "rb")
    1.35              s = f.read()
    1.36              f.close()