[llvm-commits] [zorg] r99118 - in /zorg/trunk/lnt: lnt/lnttool/ lnt/lnttool/__init__.py lnt/viewer/app.py lnt/viewer/zorg.wsgi setup.py
Daniel Dunbar
daniel at zuster.org
Sun Mar 21 04:37:34 PDT 2010
Author: ddunbar
Date: Sun Mar 21 06:37:34 2010
New Revision: 99118
URL: http://llvm.org/viewvc/llvm-project?rev=99118&view=rev
Log:
LNT: Add setuptools support, which makes it much easier to test (e.g., in a virtualenv).
Also, add a 'lnt' command line tool.
Added:
zorg/trunk/lnt/lnt/lnttool/
zorg/trunk/lnt/lnt/lnttool/__init__.py
zorg/trunk/lnt/lnt/viewer/app.py (contents, props changed)
- copied, changed from r99117, zorg/trunk/lnt/lnt/viewer/zorg.wsgi
zorg/trunk/lnt/setup.py
Modified:
zorg/trunk/lnt/lnt/viewer/zorg.wsgi
Added: zorg/trunk/lnt/lnt/lnttool/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/lnttool/__init__.py?rev=99118&view=auto
==============================================================================
--- zorg/trunk/lnt/lnt/lnttool/__init__.py (added)
+++ zorg/trunk/lnt/lnt/lnttool/__init__.py Sun Mar 21 06:37:34 2010
@@ -0,0 +1,13 @@
+"""Implement the command line 'lnt' tool."""
+
+from werkzeug import script
+
+from lnt.viewer import app
+
+action_runserver = script.make_runserver(app.create_app, use_reloader=True)
+
+def main():
+ script.run(globals())
+
+if __name__ == '__main__':
+ main()
Copied: zorg/trunk/lnt/lnt/viewer/app.py (from r99117, zorg/trunk/lnt/lnt/viewer/zorg.wsgi)
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/app.py?p2=zorg/trunk/lnt/lnt/viewer/app.py&p1=zorg/trunk/lnt/lnt/viewer/zorg.wsgi&r1=99117&r2=99118&rev=99118&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/zorg.wsgi (original)
+++ zorg/trunk/lnt/lnt/viewer/app.py Sun Mar 21 06:37:34 2010
@@ -1,8 +1,5 @@
-#!/usr/bin/env python2.6
-# -*- Python -*-
-
-import sys
import os
+import sys
def create_publisher():
import warnings
@@ -30,12 +27,6 @@
from viewer import publisher
return publisher.create_publisher(configPath, configData, threaded=True)
-from quixote.wsgi import QWIP
-application = QWIP(create_publisher())
-
-if __name__ == '__main__':
- from wsgiref.simple_server import make_server
- print "Running test application."
- print " open http://localhost:8000/"
- httpd = make_server('', 8000, application)
- httpd.serve_forever()
+def create_app():
+ import quixote.wsgi
+ return quixote.wsgi.QWIP(create_publisher())
Modified: zorg/trunk/lnt/lnt/viewer/zorg.wsgi
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/zorg.wsgi?rev=99118&r1=99117&r2=99118&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/zorg.wsgi (original)
+++ zorg/trunk/lnt/lnt/viewer/zorg.wsgi Sun Mar 21 06:37:34 2010
@@ -1,37 +1,9 @@
#!/usr/bin/env python2.6
# -*- Python -*-
-import sys
-import os
+import app
-def create_publisher():
- import warnings
- warnings.simplefilter("ignore", category=DeprecationWarning)
-
- # We expect the config file to be adjacent to the absolute path of
- # the cgi script.
- configPath = os.path.join(os.path.dirname(os.path.realpath(__file__)),
- "zorg.cfg")
- configData = {}
- exec open(configPath) in configData
-
- # Find the zorg installation dir.
- zorgDir = os.path.join(os.path.dirname(configPath),
- configData.get('zorg', ''))
- if zorgDir and zorgDir not in sys.path:
- sys.path.append(zorgDir)
-
- # Optionally enable auto-restart.
- if configData.get('wsgiAutoRestart', 'True'):
- from viewer import wsgi_restart
- wsgi_restart.track(configPath)
- wsgi_restart.start()
-
- from viewer import publisher
- return publisher.create_publisher(configPath, configData, threaded=True)
-
-from quixote.wsgi import QWIP
-application = QWIP(create_publisher())
+application = app.create_app()
if __name__ == '__main__':
from wsgiref.simple_server import make_server
Added: zorg/trunk/lnt/setup.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/setup.py?rev=99118&view=auto
==============================================================================
--- zorg/trunk/lnt/setup.py (added)
+++ zorg/trunk/lnt/setup.py Sun Mar 21 06:37:34 2010
@@ -0,0 +1,34 @@
+from setuptools import setup, find_packages
+setup(
+ name = "LNT",
+ version = "0.3",
+
+ author = "Daniel Dunbar",
+ author_email = "daniel at zuster.org",
+ url = 'http://llvm.org',
+ license = 'BSD',
+
+ description = "LLVM Nightly Test Infrastructure",
+ keywords = 'web testing performance development llvm',
+
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Environment :: Web Environment',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: University of Illinois/NCSA Open Source License',
+ 'Natural Language :: English',
+ 'Operating System :: OS Independent',
+ 'Progamming Language :: Python',
+ 'Topic :: Software Development :: Quality Assurance',
+ 'Topic :: Software Development :: Testing',
+ ],
+
+ zip_safe = False,
+ packages = find_packages(),
+ entry_points = {
+ 'console_scripts': [
+ 'lnt = lnt.lnttool:main',
+ ],
+ },
+ install_requires=['Quixote==2.7b2', 'SQLAlchemy', 'Werkzeug'],
+)
More information about the llvm-commits
mailing list