Carbon Poker offers a 5 card stud game that wasn't listed here. It's not available...
[fpdb-dooglus.git] / pyfpdb / Options.py
blob92045d5e8ea90287d3d30ce0571696bb425c8c59
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
4 #Copyright 2008-2011 Ray E. Barker
5 #This program is free software: you can redistribute it and/or modify
6 #it under the terms of the GNU Affero General Public License as published by
7 #the Free Software Foundation, version 3 of the License.
9 #This program is distributed in the hope that it will be useful,
10 #but WITHOUT ANY WARRANTY; without even the implied warranty of
11 #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 #GNU General Public License for more details.
14 #You should have received a copy of the GNU Affero General Public License
15 #along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #In the "official" distribution you can find the license in agpl-3.0.txt.
18 import L10n
19 _ = L10n.get_translation()
21 import sys
22 from optparse import OptionParser
23 # http://docs.python.org/library/optparse.html
25 def fpdb_options():
27 """Process command line options for fpdb and HUD_main."""
28 parser = OptionParser()
29 parser.add_option("-x", "--errorsToConsole",
30 action="store_true",
31 help=_("If passed error output will go to the console rather than ."))
32 parser.add_option("-d", "--databaseName",
33 dest="dbname",
34 help=_("Overrides the default database name"))
35 parser.add_option("-c", "--configFile",
36 dest="config", default=None,
37 help=_("Specifies a configuration file."))
38 parser.add_option("-r", "--rerunPython",
39 action="store_true",
40 help=_("Indicates program was restarted with a different path (only allowed once)."))
41 parser.add_option("-k", "--konverter",
42 dest="hhc", default="PokerStarsToFpdb",
43 help=_("Module name for Hand History Converter"))
44 parser.add_option("-s", "--sitename",
45 dest="sitename", default=None,
46 help=_("A sitename"))
47 parser.add_option("-l", "--logging",
48 dest = "log_level",
49 choices = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'EMPTY'),
50 help = _("Error logging level:")+" (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)",
51 default = 'EMPTY')
52 parser.add_option("-v", "--version", action = "store_true",
53 help = _("Print version information and exit."))
54 parser.add_option("-u", "--usage", action="store_true", dest="usage", default=False,
55 help=_("Print some useful one liners"))
56 # The following options are used for SplitHandHistory.py
57 parser.add_option("-f", "--file", dest="filename", metavar="FILE", default=None,
58 help=_("Input file"))
59 parser.add_option("-D", "--directory", dest="directory", metavar="FILE", default=None,
60 help=_("Input directory"))
61 parser.add_option("-o", "--outpath", dest="outpath", metavar="FILE", default=None,
62 help=_("Input out path in quiet mode"))
63 parser.add_option("-a", "--archive", action="store_true", dest="archive", default=False,
64 help=_("File to be split is a PokerStars or Full Tilt Poker archive file"))
65 parser.add_option("-n", "--numhands", dest="hands", default="100", type="int",
66 help=_("How many hands do you want saved to each file. Default is 100"))
67 parser.add_option("--xloc", dest="xloc", default=None, type="int",
68 help=_("X location to open window"))
69 parser.add_option("--yloc", dest="yloc", default=None, type="int",
70 help=_("Y location to open Window"))
71 parser.add_option("--autoimport", action="store_true", dest="autoimport",
72 help=_("Auto-start Auto-import"))
73 parser.add_option("--minimized", action="store_true", dest="minimized",
74 help=_("Start Minimized"))
75 parser.add_option("--hidden", action="store_true", dest="hidden",
76 help=_("Start Hidden"))
79 (options, argv) = parser.parse_args()
80 return (options, argv)
82 def site_alias(alias):
83 """Function for converting various site aliases to the FPDB name"""
84 tmp = alias
85 aliases = {
86 "PacificPoker" : "PacificPoker",
87 "Pacific" : "PacificPoker",
88 "PokerStars" : "PokerStars",
89 "Full Tilt Poker": "Full Tilt Poker",
90 "PartyPoker" : "PartyPoker",
91 "Betfair" : "Betfair",
92 "OnGame" : "OnGame",
93 "Absolute" : "Absolute",
94 "UltimateBet" : "UltimateBet",
95 "Everleaf" : "Everleaf",
96 "Carbon" : "Carbon",
97 "iPoker" : "iPoker",
98 "Winamax" : "Winamax",
99 "Win2day" : "Win2day",
100 "Everest" : "Everest",
101 "Stars" : "PokerStars",
102 "FTP" : "Full Tilt Poker",
103 "Party" : "PartyPoker",
104 "AP" : "Absolute",
105 "UB" : "UltimateBet",
107 try:
108 tmp = aliases[alias]
109 except KeyError, e:
110 tmp = False
111 print (_("Alias '%s' unknown") % alias)
113 return tmp
115 if __name__== "__main__":
116 (options, argv) = fpdb_options()
117 print "errorsToConsole =", options.errorsToConsole
118 print "database name =", options.dbname
119 print "config file =", options.config
121 print _("press enter to end")
122 sys.stdin.readline()