Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Langhoff <martin@laptop.org>2011-01-29 02:44:32 (GMT)
committer Martin Langhoff <martin@laptop.org>2011-01-29 03:41:46 (GMT)
commit0a30a750700f6b025f8a9eff3ddb9542d060f841 (patch)
tree18c3f44e7dd5668006f2f601e2656253344a4058
parente75f384cfcfc22b5b2a05fa8c9d70509033e7e96 (diff)
Versioned binary libs and mwlib rebuild script
-rwxr-xr-xbinarylibs/linux32_27/_expander.so (renamed from mwlib/_expander.so)bin60911 -> 60911 bytes
-rwxr-xr-xbinarylibs/linux32_27/_mwscan.so (renamed from mwlib/_mwscan.so)bin81898 -> 81898 bytes
-rwxr-xr-xbinarylibs/linux32_27/_wp.so (renamed from _wp.so)bin119821 -> 119821 bytes
-rwxr-xr-xmwlib-rebuild.sh14
-rwxr-xr-xserver.py28
5 files changed, 36 insertions, 6 deletions
diff --git a/mwlib/_expander.so b/binarylibs/linux32_27/_expander.so
index 0b98cd6..0b98cd6 100755
--- a/mwlib/_expander.so
+++ b/binarylibs/linux32_27/_expander.so
Binary files differ
diff --git a/mwlib/_mwscan.so b/binarylibs/linux32_27/_mwscan.so
index 71b6af3..71b6af3 100755
--- a/mwlib/_mwscan.so
+++ b/binarylibs/linux32_27/_mwscan.so
Binary files differ
diff --git a/_wp.so b/binarylibs/linux32_27/_wp.so
index b5b536e..b5b536e 100755
--- a/_wp.so
+++ b/binarylibs/linux32_27/_wp.so
Binary files differ
diff --git a/mwlib-rebuild.sh b/mwlib-rebuild.sh
new file mode 100755
index 0000000..7696e65
--- /dev/null
+++ b/mwlib-rebuild.sh
@@ -0,0 +1,14 @@
+#!/bin/bash -x
+
+set -e
+
+platform=`python -c 'import sys, platform; \
+ print "%s%s_%s%s" % (platform.system().lower(),
+ platform.architecture()[0][0:2],
+ sys.version_info.major,
+ sys.version_info.minor)' `
+
+
+python setup.py-mwlib build_ext --inplace build
+mkdir -p binarylibs/$platform/
+find build -type f -name '_*.so' | xargs -iFILE cp FILE binarylibs/$platform/ \ No newline at end of file
diff --git a/server.py b/server.py
index 6a2bda0..9393daa 100755
--- a/server.py
+++ b/server.py
@@ -21,9 +21,11 @@
#
# Usage: server.py <dbfile> <port>
#
+## Standard libs
from __future__ import with_statement
import sys
import os
+import platform
import subprocess
import select
import codecs
@@ -35,21 +37,35 @@ import errno
import urllib
import tempfile
import re
-import wp
import xml.dom.minidom
-from pylru import lrudecorator
-
-# Uncomment to print out a large dump from the template expander.
-#os.environ['DEBUG_EXPANDER'] = '1'
-
try:
from hashlib import md5
except ImportError:
from md5 import md5
+##
+## Libs we ship -- add lib path for
+## shared objects
+##
+_root_path = os.path.dirname(__file__)
+# linux32_27" for Linux 32bits Python 2.7
+platform = "%s%s_%s%s" % (platform.system().lower(),
+ platform.architecture()[0][0:2],
+ sys.version_info.major,
+ sys.version_info.minor)
+
+sys.path.append(os.path.join(_root_path, 'binarylibs', platform))
+
+import wp
+from pylru import lrudecorator
import mwlib.htmlwriter
from mwlib import parser, scanner, expander
+# Uncomment to print out a large dump from the template expander.
+#os.environ['DEBUG_EXPANDER'] = '1'
+
+
+
class MyHTTPServer(BaseHTTPServer.HTTPServer):
def serve_forever(self, poll_interval=0.5):
"""Overridden version of BaseServer.serve_forever that does not fail