Commits

Nozomu Kaneko committed 8eca01b

generate project skelton by running paster create -t pyramid_starter

Comments (0)

Files changed (11)

+0.0
+---
+
+-  Initial version
+include *.txt *.ini *.cfg *.rst
+recursive-include hgwiki *.ico *.png *.css *.gif *.jpg *.pt *.txt *.mak *.mako *.js *.html *.xml
+HgWiki README
+[app:main]
+use = egg:HgWiki
+
+pyramid.reload_templates = true
+pyramid.debug_authorization = false
+pyramid.debug_notfound = false
+pyramid.debug_routematch = false
+pyramid.debug_templates = true
+pyramid.default_locale_name = en
+pyramid.includes = pyramid_debugtoolbar
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, hgwiki
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = INFO
+handlers = console
+
+[logger_hgwiki]
+level = DEBUG
+handlers =
+qualname = hgwiki
+
+[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

hgwiki/__init__.py

+from pyramid.config import Configurator
+from hgwiki.resources import Root
+
+def main(global_config, **settings):
+    """ This function returns a Pyramid WSGI application.
+    """
+    config = Configurator(root_factory=Root, settings=settings)
+    config.add_view('hgwiki.views.my_view',
+                    context='hgwiki:resources.Root',
+                    renderer='hgwiki:templates/mytemplate.pt')
+    config.add_static_view('static', 'hgwiki:static', cache_max_age=3600)
+    return config.make_wsgi_app()

hgwiki/resources.py

+class Root(object):
+    def __init__(self, request):
+        self.request = request
+import unittest
+
+from pyramid import testing
+
+class ViewTests(unittest.TestCase):
+    def setUp(self):
+        self.config = testing.setUp()
+
+    def tearDown(self):
+        testing.tearDown()
+
+    def test_my_view(self):
+        from hgwiki.views import my_view
+        request = testing.DummyRequest()
+        info = my_view(request)
+        self.assertEqual(info['project'], 'HgWiki')
+def my_view(request):
+    return {'project':'HgWiki'}
+[app:main]
+use = egg:HgWiki
+
+pyramid.reload_templates = false
+pyramid.debug_authorization = false
+pyramid.debug_notfound = false
+pyramid.debug_routematch = false
+pyramid.debug_templates = false
+pyramid.default_locale_name = en
+
+[server:main]
+use = egg:Paste#http
+host = 0.0.0.0
+port = 6543
+
+# Begin logging configuration
+
+[loggers]
+keys = root, hgwiki
+
+[handlers]
+keys = console
+
+[formatters]
+keys = generic
+
+[logger_root]
+level = WARN
+handlers = console
+
+[logger_hgwiki]
+level = WARN
+handlers =
+qualname = hgwiki
+
+[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
+[nosetests]
+match = ^test
+nocapture = 1
+cover-package = hgwiki
+with-coverage = 1
+cover-erase = 1
+
+[compile_catalog]
+directory = hgwiki/locale
+domain = HgWiki
+statistics = true
+
+[extract_messages]
+add_comments = TRANSLATORS:
+output_file = hgwiki/locale/HgWiki.pot
+width = 80
+
+[init_catalog]
+domain = HgWiki
+input_file = hgwiki/locale/HgWiki.pot
+output_dir = hgwiki/locale
+
+[update_catalog]
+domain = HgWiki
+input_file = hgwiki/locale/HgWiki.pot
+output_dir = hgwiki/locale
+previous = true
+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', 'pyramid_debugtoolbar']
+
+setup(name='HgWiki',
+      version='0.0',
+      description='HgWiki',
+      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="hgwiki",
+      entry_points = """\
+      [paste.app_factory]
+      main = hgwiki:main
+      """,
+      paster_plugins=['pyramid'],
+      )
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.