Mercurial > parpg-core
comparison src/parpg.py @ 180:59c4db30fe05
Created parpg.py and moved code from parpg\main.py to it.
author | KarstenBock@gmx.net |
---|---|
date | Mon, 10 Oct 2011 15:12:33 +0200 |
parents | |
children | 54c4277ed905 |
comparison
equal
deleted
inserted
replaced
179:828dcf3d4ee7 | 180:59c4db30fe05 |
---|---|
1 #!/usr/bin/env python2 | |
2 # This program is free software: you can redistribute it and/or modify | |
3 # it under the terms of the GNU General Public License as published by | |
4 # the Free Software Foundation, either version 3 of the License, or | |
5 # (at your option) any later version. | |
6 | |
7 # This program is distributed in the hope that it will be useful, | |
8 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
9 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
10 # GNU General Public License for more details. | |
11 | |
12 # You should have received a copy of the GNU General Public License | |
13 # along with this program. If not, see <http://www.gnu.org/licenses/>. | |
14 | |
15 #TODO: Modularize this script | |
16 import sys | |
17 from optparse import OptionParser | |
18 from os import path | |
19 | |
20 from parpg.main import main | |
21 | |
22 usage = ('usage: %prog [options] settings_path [system_path user_path]\n\n' | |
23 'The settings_path argument is mandatory and is the directory in \n' | |
24 'which your parpg.cfg file is located. Optionally, you may \n' | |
25 'specify where data files are located (system_path), and where \n' | |
26 'the user settings and data files should be saved to (user_path)\n\n' | |
27 'Example: python %prog .') | |
28 | |
29 parser = OptionParser(description='PARPG Launcher Script', usage=usage) | |
30 parser.add_option('-f', '--logfile', | |
31 help='Name of log file to save to') | |
32 parser.add_option('-l', '--loglevel', default='critical', | |
33 help='desired output level for log file') | |
34 opts, args = parser.parse_args() | |
35 | |
36 if not args: | |
37 parser.print_help() | |
38 sys.exit(1) | |
39 main(args, opts) |