diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2017-07-10 17:24:01 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2017-07-10 17:26:20 +0200 |
commit | 38511212bffa8e4dc0bed9c8fd0086ade5197144 (patch) | |
tree | 90d5b3f42c549522886d51dd0e7933d0e18cdeb3 | |
parent | 4545077c547825f2ab5a4704f826e3537baa1fb7 (diff) | |
download | cucutags-0.7.4.tar.gz |
Generated tags should be sorted and deduplicated.0.7.4
-rwxr-xr-x | cucutags.py | 7 | ||||
-rw-r--r-- | setup.py | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/cucutags.py b/cucutags.py index 9e19f4a..28bce1a 100755 --- a/cucutags.py +++ b/cucutags.py @@ -21,6 +21,7 @@ # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import io +import itertools import logging import os import os.path @@ -84,6 +85,9 @@ class Feature(object): def __str__(self): return self.__unicode__().encode("utf-8") + def __cmp__(self, other): + return cmp(self.text, other.text) + def match(self, targlist): """ Returns the first Target matching the current Feature line. @@ -170,7 +174,8 @@ class Session(object): logging.debug("trg.filename = %s", rel_filename) logging.debug("trg.lineno = %s", trg.lineno) out.append((feat, rel_filename, trg.lineno,)) - + out = sorted(out) + out = [x for x, _ in itertools.groupby(out)] return out def get_step(self, feature): @@ -13,7 +13,7 @@ def read(fname): setup( name='cucutags', py_modules=['cucutags'], - version="0.7.3", + version="0.7.4", description='Generates ctags for BDD .feature/behave steps', author=u'Matěj Cepl', author_email='mcepl@redhat.com', |