Changeset 679 for trunk/game/scripts


Ignore:
Timestamp:
12/04/10 00:41:10 (9 years ago)
Author:
technomage
Message:

Patch by Technomage

  • Cleaned up and redesigned the dialogue_demo.py script as per aspidites' suggestions.
  • Updated all code documentation in the dialogue_demo.py script.
  • The dialogue_demo.py script how has a proper command-line interface via the optionparser.py module.
  • dialogue_demo.py now prompts the user to select a YAML dialogue file from the dialogue subdirectory if a dialogue file path is not passed to the script.
  • Updated the optionparser.py module to raise an OptionError? when get_next_prog_arg is called and no program argument was found (e.g. for optional program arguments).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/game/scripts/common/optionparser.py

    r668 r679  
    145145            message = 'expected a {0} argument but got nothing' 
    146146            message = message.format(getattr(type_, '__name__', type_)) 
    147             self.error(message) 
     147            raise OptionError(message) 
    148148        try: 
    149149            result = type_(arg) 
Note: See TracChangeset for help on using the changeset viewer.