# HG changeset patch # User Jeff Hammel # Date 1355772878 28800 # Node ID 98a2a78dbcfddd8fd865e712482ae63f4d7eb96a # Parent 34793fb9b1b7b034bdb39732e887d7182816c634 '' diff -r 34793fb9b1b7 -r 98a2a78dbcfd bzconsole/command.py --- a/bzconsole/command.py Mon Dec 17 11:29:43 2012 -0800 +++ b/bzconsole/command.py Mon Dec 17 11:34:38 2012 -0800 @@ -11,6 +11,9 @@ from optparse import OptionParser from pprint import pprint +def read_dotfile(self): + """read information from ~/.bz""" + class Undefined(object): def __init__(self, default): self.default=default @@ -43,9 +46,9 @@ OptionParser.add_option(self, *args, **kwargs) def print_help(self): - + OptionParser.print_help(self) - + # short descriptions for commands command_descriptions = [dict(name=i, description=self.commands[i]['doc'].strip().split('\n',1)[0]) @@ -61,7 +64,7 @@ def parse(self, args=sys.argv[1:]): """global parse step""" - + self.options, args = self.parse_args(args) # help/sanity check -- should probably be separated @@ -96,7 +99,7 @@ # setup options = {} - dotfile = os.path.join(os.environ['HOME'], '.' + self.get_prog_name()) + dotfile = os.path.join(os.environ['HOME'], '.bz') if os.path.exists(dotfile): f = file(dotfile) for line in f.readlines(): @@ -187,7 +190,7 @@ Parse a docstring and get at the section describing arguments - decoration: decoration character - delimeter: delimter character - + Yields a tuple of the stripped docstring and the arguments help dictionary """