Fix HHC init and python 2.5 incompatibility

This commit is contained in:
Worros 2010-06-05 17:58:00 +08:00
parent 3b823574ab
commit 18a3af2e88

View File

@ -5,6 +5,7 @@ import Options
import HandHistoryConverter import HandHistoryConverter
(options, argv) = Options.fpdb_options() (options, argv) = Options.fpdb_options()
config = Configuration.Config()
filter = options.hhc filter = options.hhc
@ -13,7 +14,7 @@ filter_name = filter.replace("ToFpdb", "")
mod = __import__(filter) mod = __import__(filter)
obj = getattr(mod, filter_name, None) obj = getattr(mod, filter_name, None)
hhc = obj(autostart=False) hhc = obj(config, autostart=False)
if os.path.exists(options.infile): if os.path.exists(options.infile):
in_fh = codecs.open(options.infile, 'r', "utf8") in_fh = codecs.open(options.infile, 'r', "utf8")
@ -31,7 +32,7 @@ for a in m:
uniq = set(players) uniq = set(players)
for i, name in enumerate(uniq, 1): for i, name in enumerate(uniq):
filecontents = filecontents.replace(name, 'Player%d' %i) filecontents = filecontents.replace(name, 'Player%d' %i)
print filecontents print filecontents