Options: Add site_alias function

Function returns the FPDB name for a given site. Should make command line options a bit simpler
This commit is contained in:
Worros 2010-12-15 12:44:12 +08:00
parent 7269926d7b
commit 46dd6524ec

View File

@ -77,6 +77,35 @@ def fpdb_options():
(options, argv) = parser.parse_args() (options, argv) = parser.parse_args()
return (options, argv) return (options, argv)
def site_alias(alias):
"""Function for converting various site aliases to the FPDB name"""
tmp = alias
aliases = {
"PokerStars" : "PokerStars",
"Full Tilt Poker": "Full Tilt Poker",
"PartyPoker" : "PartyPoker",
"Betfair" : "Betfair",
"OnGame" : "OnGame",
"Absolute" : "Absolute",
"UltimateBet" : "UltimateBet",
"Everleaf" : "Everleaf",
"Carbon" : "Carbon",
"iPoker" : "iPoker",
"Winamax" : "Winamax",
"Win2day" : "Win2day",
"Stars" : "PokerStars",
"FTP" : "Full Tilt Poker",
"Party" : "PartyPoker",
"AP" : "Absolute",
"UB" : "UltimateBet",
}
try:
tmp = aliases[alias]
except KeyError, e:
print _("Alias '%s' unknown" % alias)
return False
if __name__== "__main__": if __name__== "__main__":
(options, argv) = fpdb_options() (options, argv) = fpdb_options()
print "errorsToConsole =", options.errorsToConsole print "errorsToConsole =", options.errorsToConsole