Skip to content
Snippets Groups Projects
Commit 37907644 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

nenolod's patch fixing URL generation.

parent ef1d7d31
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,15 @@ version = "1.0"
def do(command):
return commands.getstatusoutput(command)[1]
def urlify(extractor, commit):
prefix = urlprefix % extractor.__dict__
# Try to tinyfy a reference to a web view for this commit.
try:
url = open(urllib.urlretrieve(tinyifier + prefix + commit)[0]).read()
except:
url = prefix + commit
return url
class GitExtractor:
"Metadata extraction for the git version control system."
def __init__(self, project=None):
......@@ -99,11 +108,7 @@ class GitExtractor:
# Revision level
self.refname = do("git symbolic-ref HEAD 2>/dev/null")
self.commit = do("git rev-parse HEAD")
# Try to tinyfy a reference to a web view for this commit.
try:
self.url = open(urllib.urlretrieve(tinyifier + urlprefix + self.commit)[0]).read()
except:
self.url = urlprefix + self.commit
self.url = urlify(self, self.commit)
self.branch = os.path.basename(self.refname)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment