Philip Jenvey committed bf51177

whitespace, arrange imports

Comments (0)

Files changed (1)


 import sys
 import py
+from pypy.rpython.ootypesystem import ootype
 from pypy.tool.udir import udir
-from pypy.translator.translator import TranslationContext
-from pypy.translator.oosupport.genoo import GenOO
 from pypy.translator.backendopt.all import backend_optimizations
 from pypy.translator.backendopt.checkvirtual import check_virtual_methods
+from pypy.translator.oosupport.genoo import GenOO
+from pypy.translator.translator import TranslationContext
+from pypy.translator.jvm.constant import (
+    JVMConstantGenerator, JVMStaticMethodConst, JVMCustomDictConst,
+    JVMWeakRefConst)
+from pypy.translator.jvm.database import Database
 from pypy.translator.jvm.generator import JasminGenerator
-from pypy.translator.jvm.option import getoption
-from pypy.translator.jvm.database import Database
 from pypy.translator.jvm.log import log
 from pypy.translator.jvm.node import EntryPoint, Function
 from pypy.translator.jvm.opcodes import opcodes
-from pypy.rpython.ootypesystem import ootype
-from pypy.translator.jvm.constant import \
-     JVMConstantGenerator, JVMStaticMethodConst, JVMCustomDictConst, \
-     JVMWeakRefConst
+from pypy.translator.jvm.option import getoption
 from pypy.translator.jvm.prebuiltnodes import create_interlink_node
     def __str__(self):
         return "Error code %d running %s" % (self.res, repr(self.args))
     def pretty_print(self):
         print "vvv Stdout vvv\n"
         print self.stdout
         print "vvv Stderr vvv\n"
         print self.stderr
 class JvmGeneratedSource(object):
     An object which represents the generated sources. Contains methods
     to find out where they are located, to compile them, and to execute
         self.package = package
         self.compiled = False
         self.jasmin_files = None
         # Determine various paths:
         self.thisdir = py.path.local(__file__).dirpath()
         self.rootdir = self.thisdir.join('src')
         self.srcdir = self.rootdir.join('pypy')
         self.jnajar = self.rootdir.join('jna.jar')
-        self.jasminjar = self.rootdir.join('jasmin.jar')        
+        self.jasminjar = self.rootdir.join('jasmin.jar')
         # Compute directory where .j files are
         self.javadir = self.tmpdir
         Compiles the .java sources into .class files, ready for execution.
         jascmd = [
-            getoption('java'), 
+            getoption('java'),
             '-jar', str(self.jasminjar),
-            '-g', 
-            '-d', 
+            '-g',
+            '-d',
         def split_list(files):
             #     path_to_jre/java -jar path_to_jasmin/jasmin.jar $*
             # So we limit the length of arguments files to:
             MAXLINE = 1500
             chunk = []
             chunklen = 0
             for f in files:
             #print "Invoking jasmin on %s" % files
             self._invoke(jascmd + files, False)
             #print "... completed!"
         self.compiled = True
         return stdout, stderr, retval
 def generate_source_for_function(func, annotation, backendopt=False):
     Given a Python function and some hints about its argument types,
     generates JVM sources that call it and print the result.  Returns
     the JvmGeneratedSource object.
     if hasattr(func, 'im_func'):
         func = func.im_func
     t = TranslationContext()
     generate_source().  *You can not use one of these objects more than
     once.* """
-    TypeSystem = lambda X, db: db # TypeSystem and Database are the same object 
+    TypeSystem = lambda X, db: db # TypeSystem and Database are the same object
     Function = Function
     Database = Database
     opcodes = opcodes
     CustomDictConst   = JVMCustomDictConst
     StaticMethodConst = JVMStaticMethodConst
     WeakRefConst = JVMWeakRefConst
     def __init__(self, tmpdir, translator, entrypoint):
         'tmpdir' --- where the generated files will go.  In fact, we will
         configuration.  Right now, however, there is only one kind of
         generator: JasminGenerator """
         return JasminGenerator(self.db, self.jvmsrc.javadir)