Beispiel #1
0
    def makeJavaClass(self, javaclass, myname, methods, main=0, frozen=1):
        #print methods
        jm = JavaMaker(javaclass, myname, myname, myname,
                       self.requiredPackages, [], methods, frozen, main)
        jm.build()

        os = java.io.ByteArrayOutputStream()
        jm.classfile.write(os)
        self.out.write(myname, os)
Beispiel #2
0
	def makeJavaClass(self, javaclass, myname, methods, main=0, frozen=1):
		#print methods
		jm = JavaMaker(javaclass, myname, myname, myname, 
					self.requiredPackages, 
					[], methods, frozen, main)
		jm.build()
		
		os = java.io.ByteArrayOutputStream()
		jm.classfile.write(os)
		self.out.write(myname, os)
Beispiel #3
0
def make(name, directory, jclass, pyclass, module, properties={}):
    ps = ProxyMaker.getFile(directory, 'org.python.proxies.' + jclass)
    ProxyMaker.makeProxy(jclass, ps)
    ps.close()

    props = []
    for key, value in properties.items():
        props.append(key)
        props.append(value)

    jm = JavaMaker(jclass, pyclass, module, name, props)
    jm.build()
    s = ProxyMaker.getFile(directory, name)
    jm.classfile.write(s)
    s.close()
Beispiel #4
0
def make(name, directory, jclass, pyclass, module, properties={}):
	ps = ProxyMaker.getFile(directory, 'org.python.proxies.'+jclass)
	ProxyMaker.makeProxy(jclass, ps)
	ps.close()
		
	props = []
	for key, value in properties.items():
		props.append(key)
		props.append(value)
	
	jm = JavaMaker(jclass, pyclass, module, name, props)
	jm.build()
	s = ProxyMaker.getFile(directory, name)
	jm.classfile.write(s)
	s.close()
Beispiel #5
0
from org.python.compiler import JavaMaker, ProxyMaker

pkg = 'jjh'
pyclass = 'PythonRandom'
module = 'trand'
jname = 'java.util.Random'

name = 'org.python.proxies.'+jname
ps = ProxyMaker.getFile('c:\\jpython\\JavaCode', name)
ProxyMaker.makeProxy(jname, ps)
ps.close()



name = pkg+'.'+pyclass
jm = JavaMaker('java.util.Random', pyclass, module, name)
jm.build()

s = ProxyMaker.getFile('c:\\jpython\\JavaCode', name)
jm.classfile.write(s)
s.close()