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=_("If passed error output will go to the console rather than ."))
32 parser
.add_option("-d", "--databaseName",
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",
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("-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,
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"""
86 "PacificPoker" : "PacificPoker",
87 "Pacific" : "PacificPoker",
88 "PokerStars" : "PokerStars",
89 "Full Tilt Poker": "Full Tilt Poker",
90 "PartyPoker" : "PartyPoker",
91 "Betfair" : "Betfair",
93 "Absolute" : "Absolute",
94 "UltimateBet" : "UltimateBet",
95 "Everleaf" : "Everleaf",
98 "Winamax" : "Winamax",
99 "Win2day" : "Win2day",
100 "Everest" : "Everest",
101 "Stars" : "PokerStars",
102 "FTP" : "Full Tilt Poker",
103 "Party" : "PartyPoker",
105 "UB" : "UltimateBet",
111 print (_("Alias '%s' unknown") % alias
)
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")