Permalink
Browse files

Initial commit

  • Loading branch information...
0 parents commit 0e244338be984ac5e195089f8416d6827df51fa5 @pwaller pwaller committed Aug 15, 2011
@@ -0,0 +1,4 @@
+0.0
+---
+
+- Initial version
@@ -0,0 +1,2 @@
+include *.txt *.ini *.cfg *.rst
+recursive-include weboot *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
@@ -0,0 +1,4 @@
+WebOOT README
+
+
+
@@ -0,0 +1,25 @@
+Metadata-Version: 1.0
+Name: WebOOT
+Version: 0.0
+Summary: WebOOT
+Home-page: UNKNOWN
+Author: UNKNOWN
+Author-email: UNKNOWN
+License: UNKNOWN
+Description: WebOOT README
+
+
+
+
+
+ 0.0
+ ---
+
+ - Initial version
+
+Keywords: web pyramid pylons
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Framework :: Pylons
+Classifier: Topic :: Internet :: WWW/HTTP
+Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
@@ -0,0 +1,29 @@
+CHANGES.txt
+MANIFEST.in
+README.txt
+development.ini
+production.ini
+setup.cfg
+setup.py
+WebOOT.egg-info/PKG-INFO
+WebOOT.egg-info/SOURCES.txt
+WebOOT.egg-info/dependency_links.txt
+WebOOT.egg-info/entry_points.txt
+WebOOT.egg-info/not-zip-safe
+WebOOT.egg-info/paster_plugins.txt
+WebOOT.egg-info/requires.txt
+WebOOT.egg-info/top_level.txt
+weboot/__init__.py
+weboot/resources.py
+weboot/tests.py
+weboot/views.py
+weboot/static/favicon.ico
+weboot/static/footerbg.png
+weboot/static/headerbg.png
+weboot/static/ie6.css
+weboot/static/middlebg.png
+weboot/static/pylons.css
+weboot/static/pyramid-small.png
+weboot/static/pyramid.png
+weboot/static/transparent.gif
+weboot/templates/mytemplate.pt
@@ -0,0 +1 @@
+
@@ -0,0 +1,3 @@
+ [paste.app_factory]
+ main = weboot:main
+
@@ -0,0 +1 @@
+
@@ -0,0 +1 @@
+pyramid
@@ -0,0 +1,2 @@
+pyramid
+WebError
@@ -0,0 +1 @@
+weboot
@@ -0,0 +1,50 @@
+[app:WebOOT]
+use = egg:WebOOT
+reload_templates = true
+debug_authorization = false
+debug_notfound = false
+debug_routematch = false
+debug_templates = true
+default_locale_name = en
+results_path = /user1/pwaller/master/results
+
+[pipeline:main]
+pipeline =
+ egg:WebError#evalerror
+ WebOOT
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, weboot
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_weboot]
+level = DEBUG
+handlers =
+qualname = weboot
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+
+# End logging configuration
@@ -0,0 +1,64 @@
+[app:WebOOT]
+use = egg:WebOOT
+reload_templates = false
+debug_authorization = false
+debug_notfound = false
+debug_routematch = false
+debug_templates = false
+default_locale_name = en
+results_path = /user1/pwaller/master/results
+
+[filter:weberror]
+use = egg:WebError#error_catcher
+debug = false
+;error_log =
+;show_exceptions_in_wsgi_errors = true
+;smtp_server = localhost
+;error_email = janitor@example.com
+;smtp_username = janitor
+;smtp_password = "janitor's password"
+;from_address = paste@localhost
+;error_subject_prefix = "Pyramid Error"
+;smtp_use_tls =
+;error_message =
+
+[pipeline:main]
+pipeline =
+ weberror
+ WebOOT
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, weboot
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = WARN
+handlers = console
+
+[logger_weboot]
+level = WARN
+handlers =
+qualname = weboot
+
+[handler_console]
+class = StreamHandler
+args = (sys.stderr,)
+level = NOTSET
+formatter = generic
+
+[formatter_generic]
+format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
+
+# End logging configuration
@@ -0,0 +1,27 @@
+[nosetests]
+match = ^test
+nocapture = 1
+cover-package = weboot
+with-coverage = 1
+cover-erase = 1
+
+[compile_catalog]
+directory = weboot/locale
+domain = WebOOT
+statistics = true
+
+[extract_messages]
+add_comments = TRANSLATORS:
+output_file = weboot/locale/WebOOT.pot
+width = 80
+
+[init_catalog]
+domain = WebOOT
+input_file = weboot/locale/WebOOT.pot
+output_dir = weboot/locale
+
+[update_catalog]
+domain = WebOOT
+input_file = weboot/locale/WebOOT.pot
+output_dir = weboot/locale
+previous = true
@@ -0,0 +1,37 @@
+import os
+
+from setuptools import setup, find_packages
+
+here = os.path.abspath(os.path.dirname(__file__))
+README = open(os.path.join(here, 'README.txt')).read()
+CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
+
+requires = ['pyramid', 'WebError']
+
+setup(name='WebOOT',
+ version='0.0',
+ description='WebOOT',
+ long_description=README + '\n\n' + CHANGES,
+ classifiers=[
+ "Programming Language :: Python",
+ "Framework :: Pylons",
+ "Topic :: Internet :: WWW/HTTP",
+ "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
+ ],
+ author='',
+ author_email='',
+ url='',
+ keywords='web pyramid pylons',
+ packages=find_packages(),
+ include_package_data=True,
+ zip_safe=False,
+ install_requires=requires,
+ tests_require=requires,
+ test_suite="weboot",
+ entry_points = """\
+ [paste.app_factory]
+ main = weboot:main
+ """,
+ paster_plugins=['pyramid'],
+ )
+
@@ -0,0 +1,28 @@
+from pyramid.config import Configurator
+from weboot.resources import Root, FilesystemTraverser
+
+import ROOT as R
+R.PyConfig.IgnoreCommandLineOptions = True
+
+def setup_root():
+ R.gROOT.SetBatch()
+
+def main(global_config, **settings):
+ """ This function returns a Pyramid WSGI application.
+ """
+ setup_root()
+
+ config = Configurator(root_factory=Root, settings=settings)
+
+ config.add_view('weboot.views.my_view',
+ context='weboot:resources.Root',
+ renderer='weboot:templates/mytemplate.pt')
+
+ config.add_static_view('static', 'weboot:static')
+
+ #config.add_route("result", "/result/*traverse", factory=FilesystemTraverser)
+
+ config.scan("weboot.views")
+
+ return config.make_wsgi_app()
+
Binary file not shown.
@@ -0,0 +1,76 @@
+
+from os import listdir
+from os.path import exists, isfile, isdir, join as pjoin
+
+from pyramid.httpexceptions import HTTPNotFound
+
+import ROOT as R
+
+class LocationAware(object):
+ __name__ = ""
+ __parent__ = None
+
+ @classmethod
+ def from_parent(cls, parent, name, *args, **kwargs):
+ c = cls(parent.request, *args)
+ c.__name__ = name
+ c.__parent__ = parent
+ c.__dict__.update(kwargs)
+ return c
+
+class Root(dict, LocationAware):
+
+ def __init__(self, request):
+ self.request = request
+ self['result'] = FilesystemTraverser.from_parent(self, "result")
+
+class RootObject(LocationAware):
+ def __init__(self, request, root_object):
+ self.request = request
+ self.o = root_object
+
+ def __repr__(self):
+ return '<RootObject h="{0}">'.format(self.o)
+
+class RootFileTraverser(LocationAware):
+ def __init__(self, request, rootfile):
+ self.request, self.rootfile = request, rootfile
+
+ @property
+ def content(self):
+ keys = [k.GetName() for k in self.rootfile.GetListOfKeys()]
+ def link(p):
+ url = self.request.resource_url(self, p)
+ return '<p><a href="{0}">{1}</a></p>'.format(url, p)
+ return "".join(link(p) for p in keys)
+
+ def __getitem__(self, subpath):
+ leaf = self.rootfile.Get(subpath)
+ if not leaf:
+ raise HTTPNotFound()
+ if isinstance(leaf, R.TDirectory):
+ return RootFileTraverser.from_parent(self, subpath, leaf)
+ return RootObject.from_parent(self, subpath, leaf)
+
+class FilesystemTraverser(LocationAware):
+ def __init__(self, request):
+ self.request = request
+ self.path = request.registry.settings["results_path"]
+
+ @property
+ def content(self):
+ def link(p):
+ url = self.request.resource_url(self, p)
+ return '<p><a href="{0}">{1}</a></p>'.format(url, p)
+ return "".join(link(p) for p in listdir(self.path))
+
+ def __getitem__(self, subpath):
+ path = self.path = pjoin(self.path, subpath)
+ #print "Attempting traversal on", path, subpath
+ if isfile(path):
+ f = R.TFile(path)
+ if f.IsZombie() or not f.IsOpen():
+ raise HTTPNotFound("Failed to open {0}".format(path))
+ return RootFileTraverser.from_parent(self, subpath, f)
+ return FilesystemTraverser.from_parent(self, subpath, path=self.path)
+
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,8 @@
+* html img,
+* html .png{position:relative;behavior:expression((this.runtimeStyle.behavior="none")&&(this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
+this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "',sizingMethod='image')",
+this.src = "static/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
+this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "',sizingMethod='crop')",
+this.runtimeStyle.backgroundImage = "none")),this.pngSet=true)
+);}
+#wrap{display:table;height:100%}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.

0 comments on commit 0e24433

Please sign in to comment.