Replaced -i infile with -f file in Options.py and replaced options.infile with options.filename in SplitHandHistory.py, Anonymise.py, and ImapFetcher.py
This commit is contained in:
parent
b0cf6d3cb0
commit
0f9709390e
8
pyfpdb/Anonymise.py
Executable file → Normal file
8
pyfpdb/Anonymise.py
Executable file → Normal file
|
@ -39,17 +39,17 @@ obj = getattr(mod, filter_name, None)
|
|||
|
||||
hhc = obj(config, autostart=False)
|
||||
|
||||
if os.path.exists(options.infile):
|
||||
in_fh = codecs.open(options.infile, 'r', "utf8")
|
||||
if os.path.exists(options.filename):
|
||||
in_fh = codecs.open(options.filename, 'r', "utf8")
|
||||
filecontents = in_fh.read()
|
||||
in_fh.close()
|
||||
else:
|
||||
print _("Could not find file %s") % options.infile
|
||||
print _("Could not find file %s") % options.filename
|
||||
exit(1)
|
||||
|
||||
m = hhc.re_PlayerInfo.finditer(filecontents)
|
||||
|
||||
outfile = options.infile+".anon"
|
||||
outfile = options.filename+".anon"
|
||||
print _("Output being written to"), outfile
|
||||
|
||||
savestdout = sys.stdout
|
||||
|
|
2
pyfpdb/ImapFetcher.py
Executable file → Normal file
2
pyfpdb/ImapFetcher.py
Executable file → Normal file
|
@ -131,7 +131,7 @@ def readFile(filename, options):
|
|||
return whole_file
|
||||
|
||||
def runFake(db, config, options):
|
||||
summaryText = readFile(options.infile, options)
|
||||
summaryText = readFile(options.filename, options)
|
||||
importSummaries(db, config,[summaryText], options=options)
|
||||
|
||||
def importSummaries(db, config, summaries, options = None):
|
||||
|
|
|
@ -38,9 +38,6 @@ def fpdb_options():
|
|||
parser.add_option("-r", "--rerunPython",
|
||||
action="store_true",
|
||||
help=_("Indicates program was restarted with a different path (only allowed once)."))
|
||||
parser.add_option("-i", "--infile",
|
||||
dest="infile", default="Slartibartfast",
|
||||
help=_("Input file"))
|
||||
parser.add_option("-k", "--konverter",
|
||||
dest="hhc", default="PokerStarsToFpdb",
|
||||
help=_("Module name for Hand History Converter"))
|
||||
|
@ -54,6 +51,8 @@ def fpdb_options():
|
|||
parser.add_option("-u", "--usage", action="store_true", dest="usage", default=False,
|
||||
help=_("Print some useful one liners"))
|
||||
# The following options are used for SplitHandHistory.py
|
||||
parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None,
|
||||
help=_("Input file in quiet mode"))
|
||||
parser.add_option("-o", "--outpath", dest="outpath", metavar="FILE", default=None,
|
||||
help=_("Input out path in quiet mode"))
|
||||
parser.add_option("-a", "--archive", action="store_true", dest="archive", default=False,
|
||||
|
|
|
@ -200,7 +200,7 @@ def main(argv=None):
|
|||
options.config = Configuration.Config(file = "HUD_config.test.xml")
|
||||
|
||||
if options.filename:
|
||||
SplitHH = SplitHandHistory(options.config, options.infile, options.outpath, options.hands,
|
||||
SplitHH = SplitHandHistory(options.config, options.filename, options.outpath, options.hands,
|
||||
options.hhc, options.archive)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Loading…
Reference in New Issue
Block a user