Changeset 798


Ignore:
Timestamp:
03/07/11 16:46:03 (8 years ago)
Author:
aspidites
Message:

Patch by Aspidites

  • converted argparse declarations to optparse in order to have

native python 2.6 compatibility without requiring additional
dependencies

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/active/character_customization/game/run.py

    r796 r798  
    1717import logging 
    1818 
    19 from argparse import ArgumentParser 
     19from optparse import OptionParser 
    2020from parpg.settings import Settings 
    2121 
    22 # setup parser 
    23 parser = ArgumentParser(description='PARPG Launcher Script') 
    24 parser.add_argument('-s', '--settings', nargs='+', 
     22# Python 2.6 or lower 
     23parser = OptionParser(description='PARPG Launcher Script') 
     24parser.add_option('-s', '--settings', nargs='+', 
    2525                    dest='paths', metavar='paths', 
    2626                    default=['.'], 
    2727                    help='One or more paths to load settings from') 
    28 parser.add_argument('-f', '--logfile', 
     28parser.add_option('-f', '--logfile', 
    2929                    help='Name of log file to save to') 
    30 parser.add_argument('-l', '--loglevel', default='critical', 
     30parser.add_option('-l', '--loglevel', default='critical', 
    3131                    help='desired output level for log file') 
    32 args = parser.parse_args() 
     32args, _ = parser.parse_args() 
     33 
    3334 
    3435# initialize settings 
Note: See TracChangeset for help on using the changeset viewer.