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.
19 _
= L10n
.get_translation()
22 from optparse
import OptionParser
23 # http://docs.python.org/library/optparse.html
27 """Process command line options for fpdb and HUD_main."""
28 parser
= OptionParser()
29 parser
.add_option("-x", "--errorsToConsole",
31 help=_("Send error messages to the console rather than the log file."))
32 parser
.add_option("-d", "--databaseName",
34 help=_("Specifies a 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",
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,
47 parser
.add_option("-l", "--logging",
49 choices
= ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'EMPTY'),
50 help = _("Error logging level:")+" (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)",
52 parser
.add_option("-v", "--version", action
= "store_true",
53 help = _("Print version information and exit."))
54 parser
.add_option("-i", "--initialrun", action
= "store_true", dest
="initialRun",
55 help = _("Force initial-run dialog"))
56 parser
.add_option("-u", "--usage", action
="store_true", dest
="usage", default
=False,
57 help=_("Print some useful one liners"))
58 # The following options are used for SplitHandHistory.py
59 parser
.add_option("-f", "--file", dest
="filename", metavar
="FILE", default
=None,
61 parser
.add_option("-D", "--directory", dest
="directory", metavar
="FILE", default
=None,
62 help=_("Input directory"))
63 parser
.add_option("-o", "--outpath", dest
="outpath", metavar
="FILE", default
=None,
64 help=_("Out path in quiet mode"))
65 parser
.add_option("-a", "--archive", action
="store_true", dest
="archive", default
=False,
66 help=_("File to be split is a PokerStars or Full Tilt Poker archive file"))
67 parser
.add_option("-t", "--testdata", action
="store_true", dest
="testData", default
=False,
68 help=_("Developer option to print regression test data"))
69 parser
.add_option("-n", "--numhands", dest
="hands", default
="100", type="int",
70 help=_("How many hands do you want saved to each file. Default is 100"))
71 parser
.add_option("--xloc", dest
="xloc", default
=None, type="int",
72 help=_("X location to open window"))
73 parser
.add_option("--yloc", dest
="yloc", default
=None, type="int",
74 help=_("Y location to open window"))
75 parser
.add_option("--autoimport", action
="store_true", dest
="autoimport",
76 help=_("Auto-start Auto-import"))
77 parser
.add_option("--minimized", action
="store_true", dest
="minimized",
78 help=_("Start Minimized"))
79 parser
.add_option("--hidden", action
="store_true", dest
="hidden",
80 help=_("Start Hidden"))
83 (options
, argv
) = parser
.parse_args()
84 return (options
, argv
)
86 def site_alias(alias
):
87 """Function for converting various site aliases to the FPDB name"""
90 "PacificPoker" : "PacificPoker",
91 "Pacific" : "PacificPoker",
92 "PokerStars" : "PokerStars",
93 "Full Tilt Poker": "Full Tilt Poker",
94 "PartyPoker" : "PartyPoker",
95 "Betfair" : "Betfair",
97 "Absolute" : "Absolute",
98 "UltimateBet" : "UltimateBet",
99 "Everleaf" : "Everleaf",
102 "Winamax" : "Winamax",
105 "Everest" : "Everest",
106 "Stars" : "PokerStars",
107 "FTP" : "Full Tilt Poker",
108 "Party" : "PartyPoker",
110 "UB" : "UltimateBet",
111 "Entraction" : "Entraction",
112 "BetOnline" : "BetOnline",
113 "Microgaming" : "Microgaming",
119 print (_("Alias '%s' unknown") % alias
)
123 if __name__
== "__main__":
124 (options
, argv
) = fpdb_options()
125 print "errorsToConsole =", options
.errorsToConsole
126 print "database name =", options
.dbname
127 print "config file =", options
.config
129 print _("press enter to end")