Mercurial > hg > bzconsole
changeset 48:98a2a78dbcfd
''
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Mon, 17 Dec 2012 11:34:38 -0800 |
parents | 34793fb9b1b7 |
children | fbac55e481eb |
files | bzconsole/command.py |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 """