# HG changeset patch # User Jeff Hammel # Date 1380188371 25200 # Node ID 027a85c2a6d7294754b2b4ece0ed8a82642591b6 # Parent baecb5a6f05b1a035179e1591072dec98e19a39f bzconsole/main.py bzconsole/utils.py diff -r baecb5a6f05b -r 027a85c2a6d7 bzconsole/main.py --- 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() diff -r baecb5a6f05b -r 027a85c2a6d7 bzconsole/utils.py --- 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