Shadowrun: Awakened 29 September 2011 - Build 871
Classes | Functions | Variables
py2un Namespace Reference

Classes

class  Py2Un

Functions

def main
def translate_file
def transOp

Variables

list builtins
dictionary opTransDict

Function Documentation

def py2un::main ( )

Definition at line 621 of file py2un.py.

00622           :
00623     if (len(sys.argv) != 3):
00624         print 'py2un takes 2 parameters source and destination filepath'
00625         sys.exit(2)
00626     translate_file(sys.argv[1], sys.argv[2])
    
def py2un::translate_file (   fpath,
  outpath,
  pretty = False 
)

Definition at line 5 of file py2un.py.

00006                                                 :
00007     if not fpath:
00008         print 'No filepath supplied. Exiting.'
00009         return
00010     f = open(fpath, 'r')
00011     if not f:
00012         print 'Could not open file "' + fpath + '". Exiting.'
00013         return
00014     source = f.read()
00015     f.close()
00016     tree = ast.parse(source)
00017     translator = Py2Un()
00018     src = translator.walk_tree(tree, pretty)
00019     if src and outpath:
00020         f = open(outpath, 'w')
00021         if f:
00022             f.write(src)
00023             f.close()

def py2un::transOp (   op)

Definition at line 92 of file py2un.py.

00093                :
00094     if op in opTransDict:
00095         return opTransDict[op]
00096     return 'NotImplemented'


Variable Documentation

Definition at line 59 of file py2un.py.

dictionary py2un::opTransDict

Definition at line 24 of file py2un.py.


Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net