summaryrefslogtreecommitdiff
path: root/www/grail/files
diff options
context:
space:
mode:
authorHye-Shik Chang <perky@FreeBSD.org>2003-11-19 09:36:42 +0000
committerHye-Shik Chang <perky@FreeBSD.org>2003-11-19 09:36:42 +0000
commit765d5fc48bb0f2074f5a94114810ab3ada1dc58e (patch)
treebec23c86228fceabdb08c7d73a8cce1562961c36 /www/grail/files
parentAdd depends to p5-DBD-File, should be fix building problem. (diff)
Port to Python 2.x (up to 2.2 yet)
PR: 50230 Submitted by: thinker@branda.to
Notes
Notes: svn path=/head/; revision=94335
Diffstat (limited to 'www/grail/files')
-rw-r--r--www/grail/files/grail2
-rw-r--r--www/grail/files/patch-ab24
-rw-r--r--www/grail/files/patch-ac63
3 files changed, 88 insertions, 1 deletions
diff --git a/www/grail/files/grail b/www/grail/files/grail
index a5d15c492798..5d6569cda1b7 100644
--- a/www/grail/files/grail
+++ b/www/grail/files/grail
@@ -1,2 +1,2 @@
#!/bin/sh
-exec python %%GRAILDIR%%/grail.py ${1+"$@"}
+exec %%PYTHON_CMD%% %%GRAILDIR%%/grail.py ${1+"$@"}
diff --git a/www/grail/files/patch-ab b/www/grail/files/patch-ab
new file mode 100644
index 000000000000..0aa59d7cac8d
--- /dev/null
+++ b/www/grail/files/patch-ab
@@ -0,0 +1,24 @@
+--- grailbase/app.py.orig Wed Mar 24 23:11:52 1999
++++ grailbase/app.py Mon Mar 24 10:48:37 2003
+@@ -3,10 +3,10 @@
+
+ import os
+ import mimetypes
+-import regex
++import re
+ import string
+ import utils
+-
++regex = re
+
+ class Application:
+ def __init__(self, prefs=None):
+@@ -51,7 +51,7 @@
+
+
+ __data_scheme_re = regex.compile(
+- "data:\([^,;]*\)\(;\([^,]*\)\|\),", regex.casefold)
++ "data:\([^,;]*\)\(;\([^,]*\)\|\),")
+
+ def guess_type(self, url):
+ """Guess the type of a file based on its URL.
diff --git a/www/grail/files/patch-ac b/www/grail/files/patch-ac
new file mode 100644
index 000000000000..11c43fb9e296
--- /dev/null
+++ b/www/grail/files/patch-ac
@@ -0,0 +1,63 @@
+--- protocols/httpAPI.py.orig Sat Mar 6 06:05:19 1999
++++ protocols/httpAPI.py Mon Mar 24 10:47:50 2003
+@@ -52,9 +52,14 @@
+
+ class MyHTTP(httplib.HTTP):
+
++ def __init__(self, host='', port=None, strict=None):
++ httplib.HTTP.__init__(self, host, port, strict)
++ self.putrequest_bk = self.putrequest
++ self.putrequest = lambda r,s: MyHTTP.putrequest(self, r, s)
++
+ def putrequest(self, request, selector):
+ self.selector = selector
+- httplib.HTTP.putrequest(self, request, selector)
++ self.putrequest_bk(request, selector)
+
+ def getreply(self, file):
+ self.file = file
+@@ -81,14 +86,14 @@
+ def close(self):
+ if self.file:
+ self.file.close()
+- if self.sock:
++ if self._conn.sock:
+ try:
+- self.sock.close()
++ self._conn.sock.close()
+ except socket.error:
+ # What can you do? :-)
+ pass
+ self.file = None
+- self.sock = None
++ self._conn.sock = None
+
+
+ class http_access:
+@@ -168,7 +173,7 @@
+ def pollmeta(self, timeout=0):
+ Assert(self.state == META)
+
+- sock = self.h.sock
++ sock = self.h._conn.sock
+ try:
+ if not select.select([sock], [], [], timeout)[0]:
+ return "waiting for server response", 0
+@@ -222,7 +227,7 @@
+ self.readahead = self.readahead[maxbytes:]
+ return data
+ try:
+- data = self.h.sock.recv(maxbytes)
++ data = self.h._conn.sock.recv(maxbytes)
+ except socket.error, msg:
+ raise IOError, msg, sys.exc_traceback
+ if not data:
+@@ -231,7 +236,7 @@
+ return data
+
+ def fileno(self):
+- return self.h.sock.fileno()
++ return self.h._conn.sock.fileno()
+
+
+ # To test this, use ProtocolAPI.test()