From: Syver E. <sy...@cy...> - 2001-02-05 02:32:32
|
Greetings jython-users list readers, I come in peace! (This is my first posting you know ;-) Very cool to layer python on top of java. I have a minor patch to suggest for jythonc that tripped me up some time, while simultaneously fooling around with the classpath (new to java). jythonc in it's current incarnation doesn't seem to handle long filenames too well, or actually it's kindof javac's fault. When compiling from a directory whose path consists of spaces javac trips up when it is fed the current directory in the classpath. The following quick and dirty fix makes it work fine on my machine: As you can see the only thing it does is enclose all the paths in the classpath with "" so that javac won't trip up on directory names that looks like this: h:\my documents\tools\python source From javac.py in tools: def fixClasspath(cpath): temp = [] for each in cpath: temp.append('"' + each + '"') return temp From the function definition compile <snip> # new: # Classpath: # 1. python.jythonc.classpath property # + # 2. java.class.path property # + # 3. sourcedir # + # 4. sys.path if cpath is None: sep = java.io.File.pathSeparator cpath = [] part = sys.registry.getProperty("python.jythonc.classpath") if part != None: cpath.extend(part.split(sep)) part = getClasspath() if part != None: cpath.extend(part.split(sep)) if sourcedir: cpath.append(sourcedir) cpath.extend(sys.path) cpath = fixClasspath(cpath) # fix by Syver Enstad 5. feb. 2001 cpath = sep.join(cpath) cmd.extend([cpathopt, cpath]) cmd.extend(files) print 'Compiling with args:', cmd |