diff --git a/pyfpdb/Anonymise.py b/pyfpdb/Anonymise.py index 512980e0..1d9fd63e 100644 --- a/pyfpdb/Anonymise.py +++ b/pyfpdb/Anonymise.py @@ -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() +