Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit

Permalink
compatible with Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
fanchyna committed May 6, 2019
1 parent 48aae90 commit 403eb4c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crawler/cdi/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ def printCounter(self):
header = header.format(title0='Counter',title1='Value')
horizontal_line = '+'+'-'*(field_length+2)+'+'+'-'*22+'+'

print horizontal_line
print header
print horizontal_line
print(horizontal_line)
print(header)
print(horizontal_line)
for ct in self.counternames:
entry_row = '| {counter:<'+str(field_length)+'} | {value:<20} |'
entry_row = entry_row.format(counter=ct,value=getattr(self,ct))
horizontal_line = '+'+'-'*(field_length+2)+'+'+'-'*22+'+'

print entry_row
print horizontal_line
print(entry_row)
print(horizontal_line)

def printCountertoFile(self,filename):
allnames = list(self.counternames)
Expand All @@ -68,5 +68,5 @@ def printCountertoFile(self,filename):
for ct in self.counternames:
entry_row = '{counter:<'+str(field_length)+'} {value:<20}\n'
entry_row = entry_row.format(counter=ct,value=getattr(self,ct))
f.write(entry_row)
f.write(entry_row)
f.close()

0 comments on commit 403eb4c

Please sign in to comment.