[Checkins] SVN: zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/ Pyramid migration
Andreas Jung
andreas at andreas-jung.com
Sat Dec 11 09:56:32 EST 2010
Log message for revision 118802:
Pyramid migration
Changed:
U zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/run.py
U zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/tests.py
U zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/views.py
-=-
Modified: zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/run.py
===================================================================
--- zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/run.py 2010-12-11 14:56:18 UTC (rev 118801)
+++ zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/run.py 2010-12-11 14:56:31 UTC (rev 118802)
@@ -9,7 +9,7 @@
from views import have_authentication
def app(global_config, **kw):
- """ This function returns a repoze.bfg.router.Router object. It
+ """ This function returns a pyramid.router.Router object. It
is usually called by the PasteDeploy framework during ``paster
serve``"""
Modified: zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/tests.py
===================================================================
--- zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/tests.py 2010-12-11 14:56:18 UTC (rev 118801)
+++ zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/tests.py 2010-12-11 14:56:31 UTC (rev 118802)
@@ -35,7 +35,7 @@
""" These tests are unit tests for the view. They test the
functionality of *only* the view. They register and use dummy
- implementations of repoze.bfg functionality to allow you to avoid
+ implementations of pyramid functionality to allow you to avoid
testing 'too much'"""
def setUp(self):
@@ -62,21 +62,21 @@
class ViewIntegrationTests(unittest.TestCase):
""" These tests are integration tests for the view. These test
the functionality the view *and* its integration with the rest of
- the repoze.bfg framework. They cause the entire environment to be
+ the pyramid framework. They cause the entire environment to be
set up and torn down as if your application was running 'for
real'. This is a heavy-hammer way of making sure that your tests
have enough context to run properly, and it tests your view's
- integration with the rest of BFG. You should not use this style
+ integration with the rest of Pyramid. You should not use this style
of test to perform 'true' unit testing as tests will run faster
and will be easier to write if you use the testing facilities
- provided by bfg and only the registrations you need, as in the
+ provided by Pyramid and only the registrations you need, as in the
above ViewTests.
"""
def setUp(self):
""" This sets up the application registry with the
registrations your application declares in its configure.zcml
- (including dependent registrations for repoze.bfg itself).
+ (including dependent registrations for pyramid itself).
"""
testing.cleanUp()
import zopyx.smartprintng.server
Modified: zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/views.py
===================================================================
--- zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/views.py 2010-12-11 14:56:18 UTC (rev 118801)
+++ zopyx.smartprintng.server/branches/pyramid/zopyx/smartprintng/server/views.py 2010-12-11 14:56:31 UTC (rev 118802)
@@ -13,7 +13,7 @@
from stat import ST_CTIME
from pyramid.chameleon_zpt import render_template_to_response
from pyramid.view import static
-from pyramid.view import bfg_view
+from pyramid.view import view_config
from pyramid_xmlrpc import xmlrpc_view
from webob import Response
from models import Server
@@ -33,7 +33,7 @@
# HTTP views
##################
- at bfg_view(for_=Server, request_method='GET', permission='read')
+ at view_config(for_=Server, request_method='GET', permission='read')
class index(object):
""" The default view providing some system information """
@@ -51,7 +51,7 @@
version=version,
project='zopyx.smartprintng.server')
- at bfg_view(for_=Server, request_method='GET', permission='read', name='selftest')
+ at view_config(for_=Server, request_method='GET', permission='read', name='selftest')
class selftest(object):
""" Server selftest """
@@ -76,7 +76,7 @@
raise RuntimeError
- at bfg_view(for_=Server, name='deliver')
+ at view_config(for_=Server, name='deliver')
def deliver(context, request):
""" Send out a generated output file """
@@ -110,7 +110,7 @@
# XMLRPC views
##################
- at bfg_view(name='authenticate', for_=Server)
+ at view_config(name='authenticate', for_=Server)
@xmlrpc_view
def authenticate(context, username, password):
@@ -124,7 +124,7 @@
LOG.error(msg, exc_info=True)
return xmlrpclib.Fault(123, msg)
- at bfg_view(name='convertZIP', for_=Server)
+ at view_config(name='convertZIP', for_=Server)
@xmlrpc_view
def convertZIP(context, auth_token, zip_archive, converter_name='pdf-prince'):
@@ -141,7 +141,7 @@
return xmlrpclib.Fault(123, msg)
- at bfg_view(name='convertZIPEmail', for_=Server)
+ at view_config(name='convertZIPEmail', for_=Server)
@xmlrpc_view
def convertZIPEmail(context, auth_token, zip_archive, converter_name='pdf-prince', sender=None, recipient=None, subject=None, body=None):
@@ -158,7 +158,7 @@
return xmlrpclib.Fault(123, msg)
- at bfg_view(name='convertZIPandRedirect', for_=Server)
+ at view_config(name='convertZIPandRedirect', for_=Server)
@xmlrpc_view
def convertZIPandRedirect(context, auth_token, zip_archive, converter_name='prince-pdf', prefix=None):
""" This view appects a ZIP archive through a POST request containing all
@@ -198,13 +198,13 @@
return xmlrpclib.Fault(123, msg)
- at bfg_view(name='availableConverters', for_=Server)
+ at view_config(name='availableConverters', for_=Server)
@xmlrpc_view
def availableConverters(context):
return context.availableConverters()
- at bfg_view(name='ping', for_=Server)
+ at view_config(name='ping', for_=Server)
@xmlrpc_view
def ping(context):
return 'zopyx.smartprintng.server'
More information about the checkins
mailing list