diff mbox

[Michael,Hudson-Doyle,Merge] lp:~mwhudson/lazr-js/combo-mod_wsgi-config into lp:lazr-js

Message ID 87lj06or63.fsf@canonical.com
State Accepted
Headers show

Commit Message

Michael Hudson-Doyle March 22, 2011, 8:07 p.m. UTC
Michael Hudson-Doyle has proposed merging lp:~mwhudson/lazr-js/combo-mod_wsgi-config into lp:lazr-js.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~mwhudson/lazr-js/combo-mod_wsgi-config/+merge/54140

Hi,

This branch adds a combo.wsgi file for running the combo server with mod_wsgi.

Cheers,
mwh
diff mbox

Patch

=== added file 'combo.wsgi'
--- combo.wsgi	1970-01-01 00:00:00 +0000
+++ combo.wsgi	2011-03-21 01:15:46 +0000
@@ -0,0 +1,16 @@ 
+import os
+import site
+import sys
+
+# If you have some lazr modules installed but lazr-js is not installed in a
+# system location, the lazr 'namespace package' interferes with importing the
+# lazr-js code.
+sys.modules.pop('lazr', None)
+
+ROOT = os.path.dirname(__file__)
+
+sys.path.insert(0, os.path.join(ROOT, 'src-py'))
+
+from lazr.js.combo import combo_app
+
+application = combo_app(os.path.join(ROOT, "build"))

=== modified file 'src-py/lazr/js/build.py'
--- src-py/lazr/js/build.py	2011-01-10 14:36:00 +0000
+++ src-py/lazr/js/build.py	2011-03-21 01:15:46 +0000
@@ -13,12 +13,13 @@ 
 from glob import glob
 
 import cssutils
-import pkg_resources
 
 HERE = os.path.dirname(__file__)
 BUILD_DIR = os.path.normpath(os.path.join(HERE, '..', '..', '..', 'build'))
-SRC_DIR = pkg_resources.resource_filename(
-    pkg_resources.Requirement.parse("lazr-js"), "lazrjs")
+SRC_DIR = os.path.normpath(os.path.join(HERE, '..', '..', '..'))
+
+##SRC_DIR = pkg_resources.resource_filename(
+##    pkg_resources.Requirement.parse("lazr-js"), "lazrjs")
 
 ESCAPE_STAR_PROPERTY_RE = re.compile(r'\*([a-zA-Z0-9_-]+):')
 UNESCAPE_STAR_PROPERTY_RE = re.compile(r'([a-zA-Z0-9_-]+)_ie_star_hack:')