aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander van Gessel <ai0867@gmail.com>2013-05-15 14:50:59 +0200
committerEric S. Raymond <esr@thyrsus.com>2013-05-15 08:54:26 -0400
commit5dd1079b6a03dbc0689fc067b8e0053f37b0bc09 (patch)
tree0bc894a38607b0fcde98d6f54d1ff7de42f1a8cd
parentIncrease anti-flood-delay from 0.5 to 1 second. (diff)
downloadirker-5dd1079b6a03dbc0689fc067b8e0053f37b0bc09.tar.xz
Compatibility with python 2.4 (if simplejson is present)
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
-rwxr-xr-xirkerhook.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/irkerhook.py b/irkerhook.py
index 38b3552..e713e19 100755
--- a/irkerhook.py
+++ b/irkerhook.py
@@ -195,7 +195,11 @@ class GenericExtractor:
def has(dirname, paths):
"Test for existence of a list of paths."
- return all([os.path.exists(os.path.join(dirname, x)) for x in paths])
+ # all() is a python2.5 construct
+ for exists in [os.path.exists(os.path.join(dirname, x)) for x in paths]:
+ if not exists:
+ return False
+ return True
# VCS-dependent code begins here
@@ -265,9 +269,9 @@ class GitExtractor(GenericExtractor):
# Design choice: for git we ship only the first line, which is
# conventionally supposed to be a summary of the commit. Under
# other VCSes a different choice may be appropriate.
- metainfo = do("git log -1 '--pretty=format:%an <%ae>|%s' " + shellquote(commit.commit))
- (commit.author, _, commit.logmsg) = metainfo.partition("|")
- commit.mail = commit.author.split()[-1].strip("<>")
+ commit.author_name = do("git log -1 '--pretty=format:%an' " + shellquote(commit.commit))
+ commit.mail = do("git log -1 '--pretty=format:%ae' " + shellquote(commit.commit))
+ commit.logmsg = do("git log -1 '--pretty=format:%s' " + shellquote(commit.commit))
# This discards the part of the author's address after @.
# Might be be nice to ship the full email address, if not
# for spammers' address harvesters - getting this wrong