blob: 564e522f4561c2824a9b853fb3a7dade0695c59c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
Author: Daniel Baumann <mail@daniel-baumann.ch>
Description: Disable URL check.
If a gitweb URL is configured, the irkerhook only sends a notification if
the URL is reachable.
.
If the URL needs authentication, the hook fails. This is undesirable,
hence we switch off the URL check entirely.
diff -Naurp irker.orig/irkerhook.py irker/irkerhook.py
--- irker.orig/irkerhook.py
+++ irker/irkerhook.py
@@ -70,24 +70,7 @@ class Commit:
else:
urlprefix = urlprefixmap.get(self.urlprefix, self.urlprefix)
webview = (urlprefix % self.__dict__) + self.commit
- try:
- if urllib.urlopen(webview).getcode() == 404:
- raise IOError
- if self.tinyifier and self.tinyifier.lower() != "none":
- try:
- # Didn't get a retrieval error or 404 on the web
- # view, so try to tinyify a reference to it.
- self.url = open(urllib.urlretrieve(self.tinyifier + webview)[0]).read()
- try:
- self.url = self.url.decode('UTF-8')
- except UnicodeError:
- pass
- except IOError:
- self.url = webview
- else:
- self.url = webview
- except IOError:
- self.url = ""
+ self.url = webview
res = self.template % self.__dict__
return unicode(res, 'UTF-8') if not isinstance(res, unicode) else res
|