2009-06-15 05:14:53 +02:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
#Copyright 2008 Ray E. Barker
|
|
|
|
#This program is free software: you can redistribute it and/or modify
|
|
|
|
#it under the terms of the GNU Affero General Public License as published by
|
|
|
|
#the Free Software Foundation, version 3 of the License.
|
|
|
|
#
|
|
|
|
#This program is distributed in the hope that it will be useful,
|
|
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
#GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
#You should have received a copy of the GNU Affero General Public License
|
|
|
|
#along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#In the "official" distribution you can find the license in
|
|
|
|
#agpl-3.0.txt in the docs folder of the package.
|
|
|
|
|
|
|
|
import sys
|
|
|
|
from optparse import OptionParser
|
2010-02-02 00:37:36 +01:00
|
|
|
# http://docs.python.org/library/optparse.html
|
2009-06-15 05:14:53 +02:00
|
|
|
|
|
|
|
def fpdb_options():
|
|
|
|
|
|
|
|
"""Process command line options for fpdb and HUD_main."""
|
|
|
|
parser = OptionParser()
|
2009-11-22 06:00:23 +01:00
|
|
|
parser.add_option("-x", "--errorsToConsole",
|
|
|
|
action="store_true",
|
2009-06-15 05:14:53 +02:00
|
|
|
help="If passed error output will go to the console rather than .")
|
2009-11-22 06:00:23 +01:00
|
|
|
parser.add_option("-d", "--databaseName",
|
2009-06-15 05:14:53 +02:00
|
|
|
dest="dbname", default="fpdb",
|
|
|
|
help="Overrides the default database name")
|
2009-11-22 06:00:23 +01:00
|
|
|
parser.add_option("-c", "--configFile",
|
2009-06-15 05:14:53 +02:00
|
|
|
dest="config", default=None,
|
|
|
|
help="Specifies a configuration file.")
|
2009-11-22 06:00:23 +01:00
|
|
|
parser.add_option("-r", "--rerunPython",
|
|
|
|
action="store_true",
|
2009-08-01 13:45:10 +02:00
|
|
|
help="Indicates program was restarted with a different path (only allowed once).")
|
2009-11-30 03:52:28 +01:00
|
|
|
parser.add_option("-i", "--infile",
|
2009-12-03 09:46:10 +01:00
|
|
|
dest="infile", default="Slartibartfast",
|
2009-11-30 03:52:28 +01:00
|
|
|
help="Input file")
|
2009-12-03 09:46:10 +01:00
|
|
|
parser.add_option("-k", "--konverter",
|
|
|
|
dest="hhc", default="PokerStarsToFpdb",
|
|
|
|
help="Module name for Hand History Converter")
|
2010-02-02 00:37:36 +01:00
|
|
|
parser.add_option("-l", "--logging",
|
|
|
|
dest = "log_level",
|
|
|
|
choices = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'EMPTY'),
|
|
|
|
help = "Error logging level. (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)",
|
|
|
|
default = 'EMPTY')
|
|
|
|
parser.add_option("-v", "--version", action = "store_true",
|
|
|
|
help = "Print version information and exit.")
|
|
|
|
|
2009-11-22 06:00:23 +01:00
|
|
|
(options, argv) = parser.parse_args()
|
|
|
|
return (options, argv)
|
2009-06-15 05:14:53 +02:00
|
|
|
|
|
|
|
if __name__== "__main__":
|
2009-11-22 22:40:56 +01:00
|
|
|
(options, argv) = fpdb_options()
|
2009-06-15 05:14:53 +02:00
|
|
|
print "errorsToConsole =", options.errorsToConsole
|
|
|
|
print "database name =", options.dbname
|
|
|
|
print "config file =", options.config
|
|
|
|
|
|
|
|
print "press enter to end"
|
2009-11-22 06:00:23 +01:00
|
|
|
sys.stdin.readline()
|