Skip to content
Browse files

modernize

  • Loading branch information...
1 parent 2c8a919 commit 33dec5531d3426535ec500d870daa70a601ae255 @mcdonc mcdonc committed
Showing with 16 additions and 12 deletions.
  1. +3 −7 development.ini
  2. +8 −3 setup.py
  3. +3 −0 virginia/tests/test_views.py
  4. +2 −2 virginia/views.py
View
10 development.ini
@@ -1,13 +1,9 @@
-[app:virginia1]
+[app:main]
use = egg:virginia
root = %(here)s/content
-
-[pipeline:main]
-pipeline =
- egg:WebError
- virginia1
+pyramid.includes = pyramid_debugtoolbar
[server:main]
-use = egg:Paste#http
+use = egg:waitress#main
host = 0.0.0.0
port = 6543
View
11 setup.py
@@ -15,6 +15,8 @@
__version__ = '0.0'
import os
+import sys
+
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
@@ -22,12 +24,15 @@
CHANGES = open(os.path.join(here, 'CHANGES.txt')).read()
requires = [
- 'pyramid>=1.0a10',
- 'PasteScript',
- 'WebError',
+ 'pyramid>=1.2',
+ 'pyramid_debugtoolbar',
'zope.structuredtext',
+ 'waitress',
]
+if sys.version_info[:3] < (2,5,0):
+ raise RuntimeError('This application requires Python 2.6+')
+
setup(name='virginia',
version=__version__,
description='Serve slightly dynamic filesystem content via Pyramid',
View
3 virginia/tests/test_views.py
@@ -1,5 +1,7 @@
import unittest
from pyramid import testing
+from pyramid.interfaces import IResponse
+from zope.interface import implementer
class FileViewTests(unittest.TestCase):
def setUp(self):
@@ -128,6 +130,7 @@ class DummyFile:
def __init__(self, path):
self.path = path
+@implementer(IResponse) # dont try to convert to response when returned
class DummyResponse:
status = '200 OK'
headerlist = ()
View
4 virginia/views.py
@@ -6,8 +6,8 @@
from zope.structuredtext import stx2html
-from webob import Response
-from webob.exc import HTTPFound
+from pyramid.response import Response
+from pyramid.httpexceptions import HTTPFound
from pyramid.view import render_view_to_response
from pyramid.view import view_config

0 comments on commit 33dec55

Please sign in to comment.
Something went wrong with that request. Please try again.