Write Anonymise output to .anon file, rather than the terminal
This commit is contained in:
parent
fb51ea03f7
commit
38ad49bf38
|
@ -4,6 +4,7 @@ import codecs
|
|||
import Options
|
||||
import HandHistoryConverter
|
||||
import Configuration
|
||||
import sys
|
||||
|
||||
(options, argv) = Options.fpdb_options()
|
||||
config = Configuration.Config()
|
||||
|
@ -27,6 +28,13 @@ else:
|
|||
|
||||
m = hhc.re_PlayerInfo.finditer(filecontents)
|
||||
|
||||
outfile = options.infile+".anon"
|
||||
print "Output being written to", outfile
|
||||
|
||||
savestdout = sys.stdout
|
||||
fsock = open(outfile,"w")
|
||||
sys.stdout = fsock
|
||||
|
||||
players = []
|
||||
for a in m:
|
||||
players = players + [a.group('PNAME')]
|
||||
|
@ -37,3 +45,7 @@ for i, name in enumerate(uniq):
|
|||
filecontents = filecontents.replace(name, 'Player%d' %i)
|
||||
|
||||
print filecontents
|
||||
|
||||
sys.stdout = savestdout
|
||||
fsock.close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user