From ab83f74f6162683f22da354532c7cf5353bf940f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Thu, 3 Feb 2011 21:32:19 +0100 Subject: Sort some lists. --- gitnoti.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gitnoti.py b/gitnoti.py index db39ce1..a8d5f05 100755 --- a/gitnoti.py +++ b/gitnoti.py @@ -267,11 +267,11 @@ class Bot(irc.IRCClient): tags = self.get_tags(repo, name) if len(branches) and len(tags): raise GitnoitpyAmbiguousException('Ambiguous name: %s (\002branches\002 %s tags \002%s\002' % ( - name, ', '.join((x.name for x in branches)), ', '.join((x.name for x in tags)))) + name, ', '.join(sorted([x.name for x in branches])), ', '.join(sorted([x.name for x in tags])))) elif len(branches) > 1: - raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join((x.name for x in branches)))) + raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join(sorted([x.name for x in branches])))) elif len(tags) > 1: - raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join((x.name for x in tags)))) + raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join(sorted([x.name for x in tags])))) elif len(branches): commits, branch = [branches[0].commit], branches[0].name elif len(tags): @@ -301,7 +301,7 @@ class Bot(irc.IRCClient): if messagelist[0].startswith(self.nickname): cmd = messagelist[1].lower() if cmd == 'list': - s = 'Repos: %s' % ', '.join([os.path.splitext(os.path.basename(x))[0] for x in repos.keys()]) + s = 'Repos: %s' % ', '.join(sorted([os.path.splitext(os.path.basename(x))[0] for x in repos.keys()])) self.msg(target, s) elif cmd == 'show': if len(messagelist) < 3: @@ -337,7 +337,7 @@ class Bot(irc.IRCClient): return reponame = os.path.splitext(os.path.basename(repo.working_dir))[0] - self.msg(target, '\002%s\002 has branches %s' % (reponame, ', '.join(['\002%s\002' % h.name for h in repo.heads]))) + self.msg(target, '\002%s\002 has branches %s' % (reponame, ', '.join(sorted(['\002%s\002' % h.name for h in repo.heads])))) elif cmd == 'tags': if not len(messagelist) == 3: self.msg(target, 'Usage: %s tags REPO' % self.nickname) @@ -351,7 +351,7 @@ class Bot(irc.IRCClient): if not len(repo.tags): self.msg(target, '\002%s\002 has no tags.' % reponame) else: - self.msg(target, '\002%s\002 has tags %s' % (reponame, ', '.join(['\002%s\002' % t.name for t in repo.tags]))) + self.msg(target, '\002%s\002 has tags %s' % (reponame, ', '.join(sorted(['\002%s\002' % t.name for t in repo.tags])))) class BotFactory(protocol.ReconnectingClientFactory): protocol = Bot -- cgit v1.2.3