remove any additional print
Showing
1 changed file
with
6 additions
and
8 deletions
... | @@ -63,12 +63,12 @@ def engine(ifile,ofile,vars): | ... | @@ -63,12 +63,12 @@ def engine(ifile,ofile,vars): |
63 | matches = template.pattern.findall(template.template) | 63 | matches = template.pattern.findall(template.template) |
64 | 64 | ||
65 | if len(matches): | 65 | if len(matches): |
66 | print '[ MATCHES ] - ', matches | 66 | #print '[ MATCHES ] - ', matches |
67 | outputText = template.safe_substitute(vars) | 67 | outputText = template.safe_substitute(vars) |
68 | print "[ TEMPLATING ] - %s "%ifile | 68 | #print "[ TEMPLATING ] - %s "%ifile |
69 | 69 | ||
70 | if printit: | 70 | if printit: |
71 | print "AFTER TEMPLATE:" | 71 | #print "AFTER TEMPLATE:" |
72 | #print outputText | 72 | #print outputText |
73 | print outputText.encode('ascii', 'ignore') | 73 | print outputText.encode('ascii', 'ignore') |
74 | else: | 74 | else: |
... | @@ -93,17 +93,16 @@ def main(argv): | ... | @@ -93,17 +93,16 @@ def main(argv): |
93 | sys.exit(2) | 93 | sys.exit(2) |
94 | 94 | ||
95 | global debug, vars, ifile, ofile,printit, recursive | 95 | global debug, vars, ifile, ofile,printit, recursive |
96 | print options | ||
97 | 96 | ||
98 | 97 | ||
99 | for opt, arg in options: | 98 | for opt, arg in options: |
100 | if opt in ('-v','--vars','--v'): | 99 | if opt in ('-v','--vars','--v'): |
101 | if os.path.isfile(arg): | 100 | if os.path.isfile(arg): |
102 | with open(arg) as data_file: | 101 | with open(arg) as data_file: |
103 | print "using file" | 102 | #print "using file" |
104 | vars = json.load(data_file) | 103 | vars = json.load(data_file) |
105 | else: | 104 | else: |
106 | print "using environment" | 105 | #print "using environment" |
107 | vars=os.environ | 106 | vars=os.environ |
108 | 107 | ||
109 | elif opt in ('-r','--r'): | 108 | elif opt in ('-r','--r'): |
... | @@ -142,7 +141,6 @@ def main(argv): | ... | @@ -142,7 +141,6 @@ def main(argv): |
142 | 141 | ||
143 | 142 | ||
144 | if recursive : | 143 | if recursive : |
145 | print folder | ||
146 | count=0 | 144 | count=0 |
147 | for path, dirs, files in os.walk(folder): | 145 | for path, dirs, files in os.walk(folder): |
148 | for filename in files: | 146 | for filename in files: |
... | @@ -153,7 +151,7 @@ def main(argv): | ... | @@ -153,7 +151,7 @@ def main(argv): |
153 | count+=1 | 151 | count+=1 |
154 | else: | 152 | else: |
155 | print "file %s does not exists"%fullpath | 153 | print "file %s does not exists"%fullpath |
156 | print "successfully templated %s files"%str(count) | 154 | #print "successfully templated %s files"%str(count) |
157 | 155 | ||
158 | elif ifile != '': | 156 | elif ifile != '': |
159 | engine(ifile, ofile, vars ) | 157 | engine(ifile, ofile, vars ) | ... | ... |
-
Please register or sign in to post a comment