47 |
|
|
48 |
# Main program |
# Main program |
49 |
|
|
50 |
|
path = os.path.abspath(os.curdir) |
51 |
|
if not path.endswith('/'): path = path + '/' |
52 |
|
|
53 |
if len(sys.argv) == 3: |
if len(sys.argv) == 3: |
54 |
path = sys.argv[1] |
if not sys.argv[1].startswith('/'): |
55 |
|
path = path + sys.argv[1] |
56 |
|
else: |
57 |
|
path = sys.argv[1] |
58 |
outFile = sys.argv[2] |
outFile = sys.argv[2] |
59 |
elif len(sys.argv) == 2: |
elif len(sys.argv) == 2: |
60 |
if sys.argv[1] == '--help' or sys.argv[1] == '-h': |
if sys.argv[1] == '--help' or sys.argv[1] == '-h': |
63 |
print " ejemplo: py2dot /dir test.dot" |
print " ejemplo: py2dot /dir test.dot" |
64 |
print "" |
print "" |
65 |
sys.exit(0) |
sys.exit(0) |
66 |
if sys.argv[1].startswith('./'): |
if not sys.argv[1].startswith('/'): |
67 |
path = os.path.abspath(os.curdir) + sys.argv[1][1:] |
path = path + sys.argv[1] |
68 |
else: |
else: |
69 |
path = sys.argv[1] |
path = sys.argv[1] |
70 |
outFile = 'outfile.dot' |
outFile = 'outfile.dot' |
71 |
else: |
else: |
|
path = os.path.abspath(os.curdir) |
|
72 |
outFile = 'outfile.dot' |
outFile = 'outfile.dot' |
73 |
|
|
|
|
|
74 |
initialDir = os.path.abspath(os.curdir) |
initialDir = os.path.abspath(os.curdir) |
75 |
|
|
|
|
|
76 |
classes = {} |
classes = {} |
77 |
surfDirs(path) |
surfDirs(path) |
78 |
|
|