Mercurial > hg > bzconsole
changeset 57:027a85c2a6d7
bzconsole/main.py bzconsole/utils.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 26 Sep 2013 02:39:31 -0700 |
parents | baecb5a6f05b |
children | cb3330bcff99 |
files | bzconsole/main.py bzconsole/utils.py |
diffstat | 2 files changed, 18 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bzconsole/main.py Sun Sep 22 17:37:44 2013 -0700 +++ b/bzconsole/main.py Thu Sep 26 02:39:31 2013 -0700 @@ -1,5 +1,6 @@ #!/usr/bin/env python +import os import sys from api import BZapi from command import CommandParser @@ -12,6 +13,10 @@ """read from a file [NOTIMPLEMENTED]""" raise NotImplementedError + def ls(self, directory=os.getcwd()): + """list bug related files in the given directory""" + + def unique(self, component=None): """display unique and duplicated components""" unique, dupe = self._unique_components()
--- a/bzconsole/utils.py Sun Sep 22 17:37:44 2013 -0700 +++ b/bzconsole/utils.py Thu Sep 26 02:39:31 2013 -0700 @@ -17,3 +17,16 @@ buffer = file(tmpfile).read().strip() os.remove(tmpfile) return buffer + +def match(string): + """return bug # in the string or None if not found""" + string = string.lower() + + index = string.find('bug') + if index == -1: + return + index += len('bug') + if string[index+1] in ('-', ' ', '+', '_', '=',): + index += 1 + start = index + raise NotImplementedError