From b0cf6d3cb015098fe7daef5b150c9e6ac841fb43 Mon Sep 17 00:00:00 2001 From: Chaz Date: Wed, 13 Oct 2010 02:18:36 -0400 Subject: [PATCH 1/2] removed -f filename from Options.py and replaced its use in SplitHandHistory.py with -i infile --- pyfpdb/Options.py | 2 -- pyfpdb/SplitHandHistory.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/pyfpdb/Options.py b/pyfpdb/Options.py index 4646cb6e..3c9b3930 100644 --- a/pyfpdb/Options.py +++ b/pyfpdb/Options.py @@ -54,8 +54,6 @@ 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, diff --git a/pyfpdb/SplitHandHistory.py b/pyfpdb/SplitHandHistory.py index 8be80e66..f37325a2 100644 --- a/pyfpdb/SplitHandHistory.py +++ b/pyfpdb/SplitHandHistory.py @@ -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.filename, options.outpath, options.hands, + SplitHH = SplitHandHistory(options.config, options.infile, options.outpath, options.hands, options.hhc, options.archive) if __name__ == '__main__': From 0f9709390e6ccd5720eb5965200ca0f0814d9bde Mon Sep 17 00:00:00 2001 From: Chaz Date: Wed, 13 Oct 2010 02:23:41 -0400 Subject: [PATCH 2/2] Replaced -i infile with -f file in Options.py and replaced options.infile with options.filename in SplitHandHistory.py, Anonymise.py, and ImapFetcher.py --- pyfpdb/Anonymise.py | 8 ++++---- pyfpdb/ImapFetcher.py | 2 +- pyfpdb/Options.py | 5 ++--- pyfpdb/SplitHandHistory.py | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) mode change 100755 => 100644 pyfpdb/Anonymise.py mode change 100755 => 100644 pyfpdb/ImapFetcher.py diff --git a/pyfpdb/Anonymise.py b/pyfpdb/Anonymise.py old mode 100755 new mode 100644 index ffaa6e70..166651e8 --- a/pyfpdb/Anonymise.py +++ b/pyfpdb/Anonymise.py @@ -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 diff --git a/pyfpdb/ImapFetcher.py b/pyfpdb/ImapFetcher.py old mode 100755 new mode 100644 index 1d2068d7..ba62673e --- a/pyfpdb/ImapFetcher.py +++ b/pyfpdb/ImapFetcher.py @@ -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): diff --git a/pyfpdb/Options.py b/pyfpdb/Options.py index 3c9b3930..b8be3d2a 100644 --- a/pyfpdb/Options.py +++ b/pyfpdb/Options.py @@ -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, diff --git a/pyfpdb/SplitHandHistory.py b/pyfpdb/SplitHandHistory.py index f37325a2..8be80e66 100644 --- a/pyfpdb/SplitHandHistory.py +++ b/pyfpdb/SplitHandHistory.py @@ -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__':