more string cleaning, remove useless CLI option from GBI

This commit is contained in:
Steffen Schaumburg 2011-04-09 18:49:09 +02:00
parent ad43f241eb
commit e4ab1f37cf
3 changed files with 12 additions and 17 deletions

View File

@ -129,18 +129,18 @@ def get_config(file_name, fallback = True):
if not config_found and fallback: if not config_found and fallback:
shutil.copyfile(example_path, config_path) shutil.copyfile(example_path, config_path)
example_copy = True example_copy = True
msg = _("No %s found\n in %s\n or %s\n") % (file_name, exec_dir, default_dir) \ msg = _("No %s found\n in %s\n or %s") % (file_name, exec_dir, default_dir) \
+ _("Config file has been created at %s.") % (config_path+"\n") + " " + _("Config file has been created at %s.") % (config_path+"\n")
print msg print msg
logging.info(msg) logging.info(msg)
except: except:
print _("Error copying .example config file, cannot fall back. Exiting.\n") print _("Error copying .example config file, cannot fall back. Exiting."), "\n"
sys.stderr.write(_("Error copying .example config file, cannot fall back. Exiting.\n")) sys.stderr.write(_("Error copying .example config file, cannot fall back. Exiting.")+"\n")
sys.stderr.write( str(sys.exc_info()) ) sys.stderr.write( str(sys.exc_info()) )
sys.exit() sys.exit()
elif fallback: elif fallback:
print _("No %s found, cannot fall back. Exiting.\n") % file_name print _("No %s found, cannot fall back. Exiting.") % file_name, "\n"
sys.stderr.write(_("No %s found, cannot fall back. Exiting.\n") % file_name) sys.stderr.write((_("No %s found, cannot fall back. Exiting.") % file_name) + "\n")
sys.exit() sys.exit()
#print "get_config: returning "+str( (config_path,example_copy,example_path) ) #print "get_config: returning "+str( (config_path,example_copy,example_path) )

View File

@ -663,18 +663,18 @@ class Fulltilt(HandHistoryConverter):
tourney.buyin = 100*Decimal(clearMoneyString(mg['BUYIN'])) tourney.buyin = 100*Decimal(clearMoneyString(mg['BUYIN']))
else : else :
if 100*Decimal(clearMoneyString(mg['BUYIN'])) != tourney.buyin: if 100*Decimal(clearMoneyString(mg['BUYIN'])) != tourney.buyin:
log.error(_("Conflict between buyins read in topline (%s) and in BuyIn field (%s)") % (tourney.buyin, 100*Decimal(re.sub(u',', u'', "%s" % mg['BUYIN']))) ) log.error(_("Conflict between buyins read in top line (%s) and in BuyIn field (%s)") % (tourney.buyin, 100*Decimal(re.sub(u',', u'', "%s" % mg['BUYIN']))) )
tourney.subTourneyBuyin = 100*Decimal(clearMoneyString(mg['BUYIN'])) tourney.subTourneyBuyin = 100*Decimal(clearMoneyString(mg['BUYIN']))
if mg['FEE'] is not None: if mg['FEE'] is not None:
if tourney.fee is None: if tourney.fee is None:
tourney.fee = 100*Decimal(clearMoneyString(mg['FEE'])) tourney.fee = 100*Decimal(clearMoneyString(mg['FEE']))
else : else :
if 100*Decimal(clearMoneyString(mg['FEE'])) != tourney.fee: if 100*Decimal(clearMoneyString(mg['FEE'])) != tourney.fee:
log.error(_("Conflict between fees read in topline (%s) and in BuyIn field (%s)") % (tourney.fee, 100*Decimal(clearMoneyString(mg['FEE']))) ) log.error(_("Conflict between fees read in top line (%s) and in BuyIn field (%s)") % (tourney.fee, 100*Decimal(clearMoneyString(mg['FEE']))) )
tourney.subTourneyFee = 100*Decimal(clearMoneyString(mg['FEE'])) tourney.subTourneyFee = 100*Decimal(clearMoneyString(mg['FEE']))
if tourney.buyin is None: if tourney.buyin is None:
log.info(_("Unable to affect a buyin to this tournament : assume it's a freeroll")) log.info(_("Unable to detect a buyin to this tournament : assume it's a freeroll"))
tourney.buyin = 0 tourney.buyin = 0
tourney.fee = 0 tourney.fee = 0
else: else:
@ -784,9 +784,9 @@ class Fulltilt(HandHistoryConverter):
tourney.hero = heroName tourney.hero = heroName
# Is this really useful ? # Is this really useful ?
if heroName not in tourney.ranks: if heroName not in tourney.ranks:
print (_("%s not found in tourney.ranks ...") % heroName) print (_("%s not found in %s...") % ("tourney.ranks", heroName))
elif (tourney.ranks[heroName] != Decimal(n.group('HERO_FINISHING_POS'))): elif (tourney.ranks[heroName] != Decimal(n.group('HERO_FINISHING_POS'))):
print (_("Bad parsing : finish position incoherent : %s / %s") % (tourney.ranks[heroName], n.group('HERO_FINISHING_POS'))) print (_("Error:")+ _("Parsed finish position incoherent : %s / %s") % (tourney.ranks[heroName], n.group('HERO_FINISHING_POS')))
return True return True

View File

@ -341,9 +341,7 @@ def main(argv=None):
parser = OptionParser() parser = OptionParser()
parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None, parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None,
help=_("Input file in quiet mode")) help=_("Input file"))
parser.add_option("-q", "--quiet", action="store_false", dest="gui", default=True,
help=_("don't start gui; deprecated (just give a filename with -f)."))
parser.add_option("-c", "--convert", dest="filtername", default=None, metavar="FILTER", parser.add_option("-c", "--convert", dest="filtername", default=None, metavar="FILTER",
help=_("Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)")) help=_("Conversion filter (*Full Tilt Poker, PokerStars, Everleaf, Absolute)"))
parser.add_option("-x", "--failOnError", action="store_true", default=False, parser.add_option("-x", "--failOnError", action="store_true", default=False,
@ -378,9 +376,6 @@ def main(argv=None):
settings.update(config.get_import_parameters()) settings.update(config.get_import_parameters())
settings.update(config.get_default_paths()) settings.update(config.get_default_paths())
if not options.gui:
print _('-q is deprecated. Just use "-f filename" instead')
# This is because -q on its own causes an error, so -f is necessary and sufficient for cmd line use
if not options.filename: if not options.filename:
i = GuiBulkImport(settings, config, None) i = GuiBulkImport(settings, config, None)
main_window = gtk.Window() main_window = gtk.Window()