Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Test
/
templar-min-old
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
0dece759
authored
2017-02-08 11:08:29 -0600
by
Marcos Cano
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
remove any additional print
1 parent
8b906f97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
src/templar.min.py
src/templar.min.py
View file @
0dece75
...
...
@@ -63,12 +63,12 @@ def engine(ifile,ofile,vars):
matches
=
template
.
pattern
.
findall
(
template
.
template
)
if
len
(
matches
):
print
'[ MATCHES ] - '
,
matches
#
print '[ MATCHES ] - ', matches
outputText
=
template
.
safe_substitute
(
vars
)
print
"[ TEMPLATING ] -
%
s "
%
ifile
#
print "[ TEMPLATING ] - %s "%ifile
if
printit
:
print
"AFTER TEMPLATE:"
#
print "AFTER TEMPLATE:"
#print outputText
print
outputText
.
encode
(
'ascii'
,
'ignore'
)
else
:
...
...
@@ -93,17 +93,16 @@ def main(argv):
sys
.
exit
(
2
)
global
debug
,
vars
,
ifile
,
ofile
,
printit
,
recursive
print
options
for
opt
,
arg
in
options
:
if
opt
in
(
'-v'
,
'--vars'
,
'--v'
):
if
os
.
path
.
isfile
(
arg
):
with
open
(
arg
)
as
data_file
:
print
"using file"
#
print "using file"
vars
=
json
.
load
(
data_file
)
else
:
print
"using environment"
#
print "using environment"
vars
=
os
.
environ
elif
opt
in
(
'-r'
,
'--r'
):
...
...
@@ -142,7 +141,6 @@ def main(argv):
if
recursive
:
print
folder
count
=
0
for
path
,
dirs
,
files
in
os
.
walk
(
folder
):
for
filename
in
files
:
...
...
@@ -153,7 +151,7 @@ def main(argv):
count
+=
1
else
:
print
"file
%
s does not exists"
%
fullpath
print
"successfully templated
%
s files"
%
str
(
count
)
#
print "successfully templated %s files"%str(count)
elif
ifile
!=
''
:
engine
(
ifile
,
ofile
,
vars
)
...
...
Please
register
or
sign in
to post a comment