Skip to content
Browse files

identify need for replacing variables with self.variable

git-svn-id: https://pyjamas.svn.sourceforge.net/svnroot/pyjamas/trunk@530 7a2bd370-bda8-463c-979e-2900ccfb811e
  • Loading branch information...
1 parent 7790a8c commit 44969bc5b165d887e39396de18957a71b8298be4 lkcl committed Apr 10, 2009
Showing with 10 additions and 0 deletions.
  1. +10 −0 contrib/java2py.py
View
10 contrib/java2py.py
@@ -1,6 +1,9 @@
#!/usr/bin/env python
""" Use this to help speed up manual conversion of e.g. GWT Java to e.g.
Pyjamas python
+
+ TODO: in java2pythonlinebyline and redofunctions, identify a list
+ of variables and functions, and do replace "variable" with "self.variable"
"""
import sys
@@ -31,10 +34,17 @@ def java2pythonlinebyline(txt):
txt = count * ' ' + txt[count+1:]
if txt[count:].startswith("protected ") >= 0:
+ # TODO: check if "class" in current line, add class name
+ # otherwise assume last word of line is variable
txt = txt.replace("protected ", "")
if txt[count:].startswith("public ") >= 0:
+ # TODO: check if "class" in current line, add class name
+ # otherwise assume last word of line is variable
txt = txt.replace("public ", "")
if txt[count:].startswith("private ") >= 0:
+ # TODO: check if "class" in current line, add class name
+ # otherwise assume last word of line is variable e.g.
+ # private final Area >>>targetArea<<<;
txt = txt.replace("private ", "")
if txt[count:].startswith("static ") >= 0:
txt = txt.replace("static ", "")

0 comments on commit 44969bc

Please sign in to comment.
Something went wrong with that request. Please try again.