Permalink
Browse files

first cut at converting bfg to pyramid

  • Loading branch information...
1 parent 6437240 commit b60bdb238fbf7965121ef6073e70343428d6dc83 @mcdonc mcdonc committed Oct 25, 2010
Showing with 1,535 additions and 1,530 deletions.
  1. +6 −0 TODO.txt
  2. +1 −1 docs/narr/MyProject/myproject/run.py
  3. +2 −2 docs/narr/MyProject/myproject/tests.py
  4. +4 −4 docs/tutorials/bfgwiki/src/authorization/tutorial/login.py
  5. +2 −2 docs/tutorials/bfgwiki/src/authorization/tutorial/models.py
  6. +1 −1 docs/tutorials/bfgwiki/src/authorization/tutorial/run.py
  7. +3 −3 docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py
  8. +3 −3 docs/tutorials/bfgwiki/src/authorization/tutorial/views.py
  9. +1 −1 docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py
  10. +2 −2 docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py
  11. +1 −1 docs/tutorials/bfgwiki/src/models/tutorial/run.py
  12. +2 −2 docs/tutorials/bfgwiki/src/models/tutorial/tests.py
  13. +1 −1 docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py
  14. +3 −3 docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py
  15. +2 −2 docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py
  16. +1 −1 docs/tutorials/bfgwiki/src/views/tutorial/run.py
  17. +3 −3 docs/tutorials/bfgwiki/src/views/tutorial/tests.py
  18. +1 −1 docs/tutorials/bfgwiki/src/views/tutorial/views.py
  19. +3 −3 docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py
  20. +2 −2 docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py
  21. +1 −1 docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py
  22. +2 −2 docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py
  23. +2 −2 docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py
  24. +1 −1 docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py
  25. +2 −2 docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py
  26. +1 −1 docs/tutorials/bfgwiki2/src/models/tutorial/run.py
  27. +2 −2 docs/tutorials/bfgwiki2/src/models/tutorial/tests.py
  28. +1 −1 docs/tutorials/bfgwiki2/src/views/tutorial/run.py
  29. +2 −2 docs/tutorials/bfgwiki2/src/views/tutorial/tests.py
  30. +1 −1 docs/tutorials/bfgwiki2/src/views/tutorial/views.py
  31. +2 −1 pyramid/__init__.py
  32. +4 −4 pyramid/authentication.py
  33. +8 −8 pyramid/authorization.py
  34. +8 −8 pyramid/chameleon_text.py
  35. +7 −7 pyramid/chameleon_zpt.py
  36. +64 −64 pyramid/configuration.py
  37. +4 −4 pyramid/events.py
  38. +2 −2 pyramid/exceptions.py
  39. +5 −5 pyramid/i18n.py
  40. +36 −36 pyramid/includes/meta.zcml
  41. +1 −1 pyramid/paster.py
  42. +11 −11 pyramid/renderers.py
  43. +2 −2 pyramid/request.py
  44. +4 −4 pyramid/resource.py
  45. +22 −22 pyramid/router.py
  46. +2 −2 pyramid/scripting.py
  47. +6 −6 pyramid/security.py
  48. +2 −2 pyramid/settings.py
  49. +4 −4 pyramid/static.py
  50. +20 −20 pyramid/testing.py
  51. +1 −1 pyramid/tests/ccbugapp/configure.zcml
  52. +1 −1 pyramid/tests/exceptionviewapp/configure.zcml
  53. +1 −1 pyramid/tests/fixtureapp/another.zcml
  54. +1 −1 pyramid/tests/fixtureapp/configure.zcml
  55. +2 −2 pyramid/tests/fixtureapp/subpackage/yetanother.zcml
  56. +1 −1 pyramid/tests/fixtureapp/views.py
  57. +1 −1 pyramid/tests/grokkedapp/__init__.py
  58. +1 −1 pyramid/tests/grokkedapp/another.py
  59. +1 −1 pyramid/tests/grokkedapp/configure.zcml
  60. +1 −1 pyramid/tests/grokkedapp/pod/notinit.py
  61. +1 −1 pyramid/tests/grokkedapp/subpackage/__init__.py
  62. +1 −1 pyramid/tests/grokkedapp/subpackage/notinit.py
  63. +1 −1 pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py
  64. +3 −3 pyramid/tests/hybridapp/configure.zcml
  65. +1 −1 pyramid/tests/restbugapp/configure.zcml
  66. +1 −1 pyramid/tests/routesapp/configure.zcml
  67. +23 −23 pyramid/tests/test_authentication.py
  68. +16 −16 pyramid/tests/test_authorization.py
  69. +16 −16 pyramid/tests/test_chameleon_text.py
  70. +16 −16 pyramid/tests/test_chameleon_zpt.py
  71. +1 −1 pyramid/tests/test_compat.py
  72. +397 −397 pyramid/tests/test_configuration.py
  73. +1 −1 pyramid/tests/test_decorator.py
  74. +3 −3 pyramid/tests/test_encode.py
  75. +28 −28 pyramid/tests/test_events.py
  76. +5 −5 pyramid/tests/test_exceptions.py
  77. +26 −26 pyramid/tests/test_i18n.py
  78. +17 −17 pyramid/tests/test_integration.py
  79. +3 −3 pyramid/tests/test_location.py
  80. +1 −1 pyramid/tests/test_log.py
  81. +2 −2 pyramid/tests/test_paster.py
  82. +29 −29 pyramid/tests/test_path.py
  83. +1 −1 pyramid/tests/test_registry.py
  84. +48 −48 pyramid/tests/test_renderers.py
  85. +5 −5 pyramid/tests/test_request.py
  86. +63 −63 pyramid/tests/test_resource.py
  87. +103 −103 pyramid/tests/test_router.py
  88. +1 −1 pyramid/tests/test_scripting.py
  89. +30 −30 pyramid/tests/test_security.py
  90. +5 −5 pyramid/tests/test_settings.py
  91. +20 −20 pyramid/tests/test_static.py
  92. +73 −73 pyramid/tests/test_testing.py
  93. +8 −8 pyramid/tests/test_threadlocal.py
  94. +34 −34 pyramid/tests/test_traversal.py
  95. +22 −22 pyramid/tests/test_url.py
  96. +11 −11 pyramid/tests/test_urldispatch.py
  97. +19 −19 pyramid/tests/test_view.py
  98. +2 −2 pyramid/tests/test_wsgi.py
  99. +140 −140 pyramid/tests/test_zcml.py
  100. +1 −1 pyramid/tests/viewdecoratorapp/configure.zcml
  101. +2 −2 pyramid/tests/viewdecoratorapp/views/views.py
  102. +1 −1 pyramid/threadlocal.py
  103. +10 −10 pyramid/traversal.py
  104. +9 −9 pyramid/url.py
  105. +8 −8 pyramid/urldispatch.py
  106. +8 −8 pyramid/view.py
  107. +2 −2 pyramid/wsgi.py
  108. +19 −19 pyramid/zcml.py
  109. +2 −3 setup.cfg
  110. +12 −13 setup.py
View
6 TODO.txt
@@ -82,3 +82,9 @@
- CRSF token machinery
+- Converter: <configure xmlns="http://namespaces.repoze.org/bfg"> ->
+ <configure xmlns="http://pyramid.pylonshq.com/">
+
+- Converter: <include package="repoze.bfg.includes" /> ->
+ <include package="pyramid.includes" />
+
View
2 docs/narr/MyProject/myproject/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from myproject.models import get_root
def app(global_config, **settings):
View
4 docs/narr/MyProject/myproject/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
View
8 docs/tutorials/bfgwiki/src/authorization/tutorial/login.py
@@ -1,10 +1,10 @@
from webob.exc import HTTPFound
-from repoze.bfg.view import bfg_view
-from repoze.bfg.url import model_url
+from pyramid.view import bfg_view
+from pyramid.url import model_url
-from repoze.bfg.security import remember
-from repoze.bfg.security import forget
+from pyramid.security import remember
+from pyramid.security import forget
from tutorial.models import Wiki
from tutorial.security import USERS
View
4 docs/tutorials/bfgwiki/src/authorization/tutorial/models.py
@@ -1,8 +1,8 @@
from persistent import Persistent
from persistent.mapping import PersistentMapping
-from repoze.bfg.security import Allow
-from repoze.bfg.security import Everyone
+from pyramid.security import Allow
+from pyramid.security import Everyone
class Wiki(PersistentMapping):
__name__ = None
View
2 docs/tutorials/bfgwiki/src/authorization/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
View
6 docs/tutorials/bfgwiki/src/authorization/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class PageModelTests(unittest.TestCase):
@@ -80,7 +80,7 @@ def _callFUT(self, context, request):
return add_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
request.subpath = ['AnotherPage']
@@ -106,7 +106,7 @@ def _callFUT(self, context, request):
return edit_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
info = self._callFUT(context, request)
View
6 docs/tutorials/bfgwiki/src/authorization/tutorial/views.py
@@ -2,11 +2,11 @@
import re
from webob.exc import HTTPFound
-from repoze.bfg.url import model_url
+from pyramid.url import model_url
-from repoze.bfg.security import authenticated_userid
+from pyramid.security import authenticated_userid
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
from tutorial.models import Page
from tutorial.models import Wiki
View
2 docs/tutorials/bfgwiki/src/basiclayout/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
View
4 docs/tutorials/bfgwiki/src/basiclayout/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
class ViewTests(unittest.TestCase):
def setUp(self):
View
2 docs/tutorials/bfgwiki/src/models/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
View
4 docs/tutorials/bfgwiki/src/models/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
class PageModelTests(unittest.TestCase):
View
2 docs/tutorials/bfgwiki/src/viewdecorators/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
View
6 docs/tutorials/bfgwiki/src/viewdecorators/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class PageModelTests(unittest.TestCase):
@@ -80,7 +80,7 @@ def _callFUT(self, context, request):
return add_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
request.subpath = ['AnotherPage']
@@ -106,7 +106,7 @@ def _callFUT(self, context, request):
return edit_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
info = self._callFUT(context, request)
View
4 docs/tutorials/bfgwiki/src/viewdecorators/tutorial/views.py
@@ -2,8 +2,8 @@
import re
from webob.exc import HTTPFound
-from repoze.bfg.url import model_url
-from repoze.bfg.view import bfg_view
+from pyramid.url import model_url
+from pyramid.view import bfg_view
from tutorial.models import Page
from tutorial.models import Wiki
View
2 docs/tutorials/bfgwiki/src/views/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from repoze.zodbconn.finder import PersistentApplicationFinder
from tutorial.models import appmaker
View
6 docs/tutorials/bfgwiki/src/views/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg import testing
+from pyramid import testing
class PageModelTests(unittest.TestCase):
@@ -80,7 +80,7 @@ def _callFUT(self, context, request):
return add_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
request.subpath = ['AnotherPage']
@@ -107,7 +107,7 @@ def _callFUT(self, context, request):
return edit_page(context, request)
def test_it_notsubmitted(self):
- from repoze.bfg.url import model_url
+ from pyramid.url import model_url
context = testing.DummyModel()
request = testing.DummyRequest()
info = self._callFUT(context, request)
View
2 docs/tutorials/bfgwiki/src/views/tutorial/views.py
@@ -2,7 +2,7 @@
import re
from webob.exc import HTTPFound
-from repoze.bfg.url import model_url
+from pyramid.url import model_url
from tutorial.models import Page
View
6 docs/tutorials/bfgwiki2/src/authorization/tutorial/login.py
@@ -1,8 +1,8 @@
from webob.exc import HTTPFound
-from repoze.bfg.security import remember
-from repoze.bfg.security import forget
-from repoze.bfg.url import route_url
+from pyramid.security import remember
+from pyramid.security import forget
+from pyramid.url import route_url
from tutorial.security import USERS
View
4 docs/tutorials/bfgwiki2/src/authorization/tutorial/models.py
@@ -1,7 +1,7 @@
import transaction
-from repoze.bfg.security import Allow
-from repoze.bfg.security import Everyone
+from pyramid.security import Allow
+from pyramid.security import Everyone
from sqlalchemy import create_engine
from sqlalchemy import Column
View
2 docs/tutorials/bfgwiki2/src/authorization/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
View
4 docs/tutorials/bfgwiki2/src/authorization/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import DBSession
View
4 docs/tutorials/bfgwiki2/src/authorization/tutorial/views.py
@@ -4,8 +4,8 @@
from webob.exc import HTTPFound
-from repoze.bfg.security import authenticated_userid
-from repoze.bfg.url import route_url
+from pyramid.security import authenticated_userid
+from pyramid.url import route_url
from tutorial.models import DBSession
from tutorial.models import Page
View
2 docs/tutorials/bfgwiki2/src/basiclayout/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
View
4 docs/tutorials/bfgwiki2/src/basiclayout/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import initialize_sql
View
2 docs/tutorials/bfgwiki2/src/models/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
View
4 docs/tutorials/bfgwiki2/src/models/tutorial/tests.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import initialize_sql
View
2 docs/tutorials/bfgwiki2/src/views/tutorial/run.py
@@ -1,4 +1,4 @@
-from repoze.bfg.configuration import Configurator
+from pyramid.configuration import Configurator
from paste.deploy.converters import asbool
from tutorial.models import initialize_sql
View
4 docs/tutorials/bfgwiki2/src/views/tutorial/tests.py
@@ -1,7 +1,7 @@
import unittest
-from repoze.bfg.configuration import Configurator
-from repoze.bfg import testing
+from pyramid.configuration import Configurator
+from pyramid import testing
def _initTestingDB():
from tutorial.models import DBSession
View
2 docs/tutorials/bfgwiki2/src/views/tutorial/views.py
@@ -4,7 +4,7 @@
from webob.exc import HTTPFound
-from repoze.bfg.url import route_url
+from pyramid.url import route_url
from tutorial.models import DBSession
from tutorial.models import Page
View
3 pyramid/__init__.py
@@ -1 +1,2 @@
-__import__('pkg_resources').declare_namespace(__name__) #pragma NO COVERAGE
+# pyramid package
+
View
8 pyramid/authentication.py
@@ -8,11 +8,11 @@
from zope.interface import implements
-from repoze.bfg.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthenticationPolicy
-from repoze.bfg.request import add_global_response_headers
-from repoze.bfg.security import Authenticated
-from repoze.bfg.security import Everyone
+from pyramid.request import add_global_response_headers
+from pyramid.security import Authenticated
+from pyramid.security import Everyone
class CallbackAuthenticationPolicy(object):
""" Abstract class """
View
16 pyramid/authorization.py
@@ -1,13 +1,13 @@
from zope.interface import implements
-from repoze.bfg.interfaces import IAuthorizationPolicy
-
-from repoze.bfg.location import lineage
-from repoze.bfg.security import ACLAllowed
-from repoze.bfg.security import ACLDenied
-from repoze.bfg.security import Allow
-from repoze.bfg.security import Deny
-from repoze.bfg.security import Everyone
+from pyramid.interfaces import IAuthorizationPolicy
+
+from pyramid.location import lineage
+from pyramid.security import ACLAllowed
+from pyramid.security import ACLDenied
+from pyramid.security import Allow
+from pyramid.security import Deny
+from pyramid.security import Everyone
class ACLAuthorizationPolicy(object):
""" An :term:`authorization policy` which consults an :term:`ACL`
View
16 pyramid/chameleon_text.py
@@ -20,14 +20,14 @@ def __init__(self, *arg, **kw):
class Parser(object):
pass
-from repoze.bfg.interfaces import ITemplateRenderer
-from repoze.bfg.interfaces import IChameleonTranslate
-
-from repoze.bfg.decorator import reify
-from repoze.bfg import renderers
-from repoze.bfg.path import caller_package
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.interfaces import ITemplateRenderer
+from pyramid.interfaces import IChameleonTranslate
+
+from pyramid.decorator import reify
+from pyramid import renderers
+from pyramid.path import caller_package
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
class TextTemplateFile(TemplateFile):
default_parser = Parser()
View
14 pyramid/chameleon_zpt.py
@@ -12,14 +12,14 @@ class PageTemplateFile(object):
def __init__(self, *arg, **kw):
raise ImportError, exc, tb
-from repoze.bfg.interfaces import IChameleonTranslate
-from repoze.bfg.interfaces import ITemplateRenderer
+from pyramid.interfaces import IChameleonTranslate
+from pyramid.interfaces import ITemplateRenderer
-from repoze.bfg.decorator import reify
-from repoze.bfg.path import caller_package
-from repoze.bfg import renderers
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.decorator import reify
+from pyramid.path import caller_package
+from pyramid import renderers
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
def renderer_factory(path):
return renderers.template_renderer_factory(path, ZPTTemplateRenderer)
View
128 pyramid/configuration.py
@@ -16,65 +16,65 @@
from zope.interface.interfaces import IInterface
from zope.interface import implements
-from repoze.bfg.interfaces import IAuthenticationPolicy
-from repoze.bfg.interfaces import IAuthorizationPolicy
-from repoze.bfg.interfaces import IChameleonTranslate
-from repoze.bfg.interfaces import IDebugLogger
-from repoze.bfg.interfaces import IDefaultPermission
-from repoze.bfg.interfaces import IDefaultRootFactory
-from repoze.bfg.interfaces import IExceptionViewClassifier
-from repoze.bfg.interfaces import ILocaleNegotiator
-from repoze.bfg.interfaces import IMultiView
-from repoze.bfg.interfaces import IPackageOverrides
-from repoze.bfg.interfaces import IRendererFactory
-from repoze.bfg.interfaces import IRendererGlobalsFactory
-from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRequestFactory
-from repoze.bfg.interfaces import IRootFactory
-from repoze.bfg.interfaces import IRouteRequest
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import ISecuredView
-from repoze.bfg.interfaces import ISettings
-from repoze.bfg.interfaces import IStaticURLInfo
-from repoze.bfg.interfaces import ITranslationDirectories
-from repoze.bfg.interfaces import ITraverser
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
-from repoze.bfg.interfaces import IExceptionResponse
-from repoze.bfg.interfaces import IException
-
-from repoze.bfg import chameleon_text
-from repoze.bfg import chameleon_zpt
-from repoze.bfg import renderers
-from repoze.bfg.renderers import RendererHelper
-from repoze.bfg.authorization import ACLAuthorizationPolicy
-from repoze.bfg.compat import all
-from repoze.bfg.compat import md5
-from repoze.bfg.events import ApplicationCreated
-from repoze.bfg.exceptions import Forbidden
-from repoze.bfg.exceptions import NotFound
-from repoze.bfg.exceptions import PredicateMismatch
-from repoze.bfg.exceptions import ConfigurationError
-from repoze.bfg.i18n import get_localizer
-from repoze.bfg.log import make_stream_logger
-from repoze.bfg.path import caller_package
-from repoze.bfg.path import package_path
-from repoze.bfg.path import package_of
-from repoze.bfg.registry import Registry
-from repoze.bfg.request import route_request_iface
-from repoze.bfg.resource import PackageOverrides
-from repoze.bfg.resource import resolve_resource_spec
-from repoze.bfg.settings import Settings
-from repoze.bfg.static import StaticURLInfo
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.threadlocal import get_current_request
-from repoze.bfg.threadlocal import manager
-from repoze.bfg.traversal import traversal_path
-from repoze.bfg.traversal import DefaultRootFactory
-from repoze.bfg.traversal import find_interface
-from repoze.bfg.urldispatch import RoutesMapper
-from repoze.bfg.view import render_view_to_response
-from repoze.bfg.view import default_exceptionresponse_view
+from pyramid.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthorizationPolicy
+from pyramid.interfaces import IChameleonTranslate
+from pyramid.interfaces import IDebugLogger
+from pyramid.interfaces import IDefaultPermission
+from pyramid.interfaces import IDefaultRootFactory
+from pyramid.interfaces import IExceptionViewClassifier
+from pyramid.interfaces import ILocaleNegotiator
+from pyramid.interfaces import IMultiView
+from pyramid.interfaces import IPackageOverrides
+from pyramid.interfaces import IRendererFactory
+from pyramid.interfaces import IRendererGlobalsFactory
+from pyramid.interfaces import IRequest
+from pyramid.interfaces import IRequestFactory
+from pyramid.interfaces import IRootFactory
+from pyramid.interfaces import IRouteRequest
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import ISecuredView
+from pyramid.interfaces import ISettings
+from pyramid.interfaces import IStaticURLInfo
+from pyramid.interfaces import ITranslationDirectories
+from pyramid.interfaces import ITraverser
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import IExceptionResponse
+from pyramid.interfaces import IException
+
+from pyramid import chameleon_text
+from pyramid import chameleon_zpt
+from pyramid import renderers
+from pyramid.renderers import RendererHelper
+from pyramid.authorization import ACLAuthorizationPolicy
+from pyramid.compat import all
+from pyramid.compat import md5
+from pyramid.events import ApplicationCreated
+from pyramid.exceptions import Forbidden
+from pyramid.exceptions import NotFound
+from pyramid.exceptions import PredicateMismatch
+from pyramid.exceptions import ConfigurationError
+from pyramid.i18n import get_localizer
+from pyramid.log import make_stream_logger
+from pyramid.path import caller_package
+from pyramid.path import package_path
+from pyramid.path import package_of
+from pyramid.registry import Registry
+from pyramid.request import route_request_iface
+from pyramid.resource import PackageOverrides
+from pyramid.resource import resolve_resource_spec
+from pyramid.settings import Settings
+from pyramid.static import StaticURLInfo
+from pyramid.threadlocal import get_current_registry
+from pyramid.threadlocal import get_current_request
+from pyramid.threadlocal import manager
+from pyramid.traversal import traversal_path
+from pyramid.traversal import DefaultRootFactory
+from pyramid.traversal import find_interface
+from pyramid.urldispatch import RoutesMapper
+from pyramid.view import render_view_to_response
+from pyramid.view import default_exceptionresponse_view
MAX_ORDER = 1 << 30
DEFAULT_PHASH = md5().hexdigest()
@@ -598,7 +598,7 @@ def make_wsgi_app(self):
the current configuration state and sends a
:class:`repoze.bfg.interfaces.IApplicationCreated`
event to all listeners."""
- from repoze.bfg.router import Router # avoid circdep
+ from pyramid.router import Router # avoid circdep
app = Router(self.registry)
# We push the registry on to the stack here in case any code
# that depends on the registry threadlocal APIs used in
@@ -1879,7 +1879,7 @@ def testing_securitypolicy(self, userid=None, groupids=(),
:func:`repoze.bfg.security.effective_principals`, and
:func:`repoze.bfg.security.principals_allowed_by_permission`.
"""
- from repoze.bfg.testing import DummySecurityPolicy
+ from pyramid.testing import DummySecurityPolicy
policy = DummySecurityPolicy(userid, groupids, permissive)
self.registry.registerUtility(policy, IAuthorizationPolicy)
self.registry.registerUtility(policy, IAuthenticationPolicy)
@@ -1962,15 +1962,15 @@ def testing_add_renderer(self, path, renderer=None):
method named ``testing_add_template`` had the same signature
and purpose in previous releases)..
"""
- from repoze.bfg.testing import DummyRendererFactory
+ from pyramid.testing import DummyRendererFactory
helper = RendererHelper(path, registry=self.registry)
factory = helper.factory
if not isinstance(factory, DummyRendererFactory):
factory = DummyRendererFactory(helper.renderer_type, helper.factory)
self.registry.registerUtility(factory, IRendererFactory,
name=helper.renderer_type)
- from repoze.bfg.testing import DummyTemplateRenderer
+ from pyramid.testing import DummyTemplateRenderer
if renderer is None:
renderer = DummyTemplateRenderer()
factory.add(helper.renderer_name, renderer)
@@ -2114,7 +2114,7 @@ def request_type_predicate(context, request):
# adds 'traverse' to the matchdict if it's specified in the
# routing args. This causes the ModelGraphTraverser to use
# the resolved traverse pattern as the traversal path.
- from repoze.bfg.urldispatch import _compile_route
+ from pyramid.urldispatch import _compile_route
_, tgenerate = _compile_route(traverse)
def traverse_predicate(context, request):
if 'traverse' in context:
View
8 pyramid/events.py
@@ -2,10 +2,10 @@
from zope.interface import implements
-from repoze.bfg.interfaces import IContextFound
-from repoze.bfg.interfaces import INewRequest
-from repoze.bfg.interfaces import INewResponse
-from repoze.bfg.interfaces import IApplicationCreated
+from pyramid.interfaces import IContextFound
+from pyramid.interfaces import INewRequest
+from pyramid.interfaces import INewResponse
+from pyramid.interfaces import IApplicationCreated
class subscriber(object):
""" Decorator activated via a :term:`scan` which treats the
View
4 pyramid/exceptions.py
@@ -1,8 +1,8 @@
from zope.configuration.exceptions import ConfigurationError as ZCE
from zope.interface import implements
-from repoze.bfg.decorator import reify
-from repoze.bfg.interfaces import IExceptionResponse
+from pyramid.decorator import reify
+from pyramid.interfaces import IExceptionResponse
import cgi
class ExceptionResponse(Exception):
View
10 pyramid/i18n.py
@@ -9,12 +9,12 @@
TranslationString = TranslationString # PyFlakes
TranslationStringFactory = TranslationStringFactory # PyFlakes
-from repoze.bfg.interfaces import ILocalizer
-from repoze.bfg.interfaces import ITranslationDirectories
-from repoze.bfg.interfaces import ILocaleNegotiator
+from pyramid.interfaces import ILocalizer
+from pyramid.interfaces import ITranslationDirectories
+from pyramid.interfaces import ILocaleNegotiator
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
class Localizer(object):
"""
View
72 pyramid/includes/meta.zcml
@@ -6,110 +6,110 @@
<meta:directive
name="view"
- schema="repoze.bfg.zcml.IViewDirective"
- handler="repoze.bfg.zcml.view"
+ schema="pyramid.zcml.IViewDirective"
+ handler="pyramid.zcml.view"
/>
<meta:directive
name="scan"
- schema="repoze.bfg.zcml.IScanDirective"
- handler="repoze.bfg.zcml.scan"
+ schema="pyramid.zcml.IScanDirective"
+ handler="pyramid.zcml.scan"
/>
<meta:directive
name="notfound"
- schema="repoze.bfg.zcml.ISystemViewDirective"
- handler="repoze.bfg.zcml.notfound"
+ schema="pyramid.zcml.ISystemViewDirective"
+ handler="pyramid.zcml.notfound"
/>
<meta:directive
name="forbidden"
- schema="repoze.bfg.zcml.ISystemViewDirective"
- handler="repoze.bfg.zcml.forbidden"
+ schema="pyramid.zcml.ISystemViewDirective"
+ handler="pyramid.zcml.forbidden"
/>
<meta:directive
name="route"
- schema="repoze.bfg.zcml.IRouteDirective"
- handler="repoze.bfg.zcml.route"
+ schema="pyramid.zcml.IRouteDirective"
+ handler="pyramid.zcml.route"
/>
<meta:directive
name="resource"
- schema="repoze.bfg.zcml.IResourceDirective"
- handler="repoze.bfg.zcml.resource"
+ schema="pyramid.zcml.IResourceDirective"
+ handler="pyramid.zcml.resource"
/>
<meta:directive
name="static"
- schema="repoze.bfg.zcml.IStaticDirective"
- handler="repoze.bfg.zcml.static"
+ schema="pyramid.zcml.IStaticDirective"
+ handler="pyramid.zcml.static"
/>
<meta:directive
name="renderer"
- schema="repoze.bfg.zcml.IRendererDirective"
- handler="repoze.bfg.zcml.renderer"
+ schema="pyramid.zcml.IRendererDirective"
+ handler="pyramid.zcml.renderer"
/>
<meta:directive
name="repozewho1authenticationpolicy"
- schema="repoze.bfg.zcml.IRepozeWho1AuthenticationPolicyDirective"
- handler="repoze.bfg.zcml.repozewho1authenticationpolicy"
+ schema="pyramid.zcml.IRepozeWho1AuthenticationPolicyDirective"
+ handler="pyramid.zcml.repozewho1authenticationpolicy"
/>
<meta:directive
name="remoteuserauthenticationpolicy"
- schema="repoze.bfg.zcml.IRemoteUserAuthenticationPolicyDirective"
- handler="repoze.bfg.zcml.remoteuserauthenticationpolicy"
+ schema="pyramid.zcml.IRemoteUserAuthenticationPolicyDirective"
+ handler="pyramid.zcml.remoteuserauthenticationpolicy"
/>
<meta:directive
name="authtktauthenticationpolicy"
- schema="repoze.bfg.zcml.IAuthTktAuthenticationPolicyDirective"
- handler="repoze.bfg.zcml.authtktauthenticationpolicy"
+ schema="pyramid.zcml.IAuthTktAuthenticationPolicyDirective"
+ handler="pyramid.zcml.authtktauthenticationpolicy"
/>
<meta:directive
name="aclauthorizationpolicy"
- schema="repoze.bfg.zcml.IACLAuthorizationPolicyDirective"
- handler="repoze.bfg.zcml.aclauthorizationpolicy"
+ schema="pyramid.zcml.IACLAuthorizationPolicyDirective"
+ handler="pyramid.zcml.aclauthorizationpolicy"
/>
<meta:directive
name="translationdir"
- schema="repoze.bfg.zcml.ITranslationDirDirective"
- handler="repoze.bfg.zcml.translationdir"
+ schema="pyramid.zcml.ITranslationDirDirective"
+ handler="pyramid.zcml.translationdir"
/>
<meta:directive
name="localenegotiator"
- schema="repoze.bfg.zcml.ILocaleNegotiatorDirective"
- handler="repoze.bfg.zcml.localenegotiator"
+ schema="pyramid.zcml.ILocaleNegotiatorDirective"
+ handler="pyramid.zcml.localenegotiator"
/>
<meta:directive
name="adapter"
- schema="repoze.bfg.zcml.IAdapterDirective"
- handler="repoze.bfg.zcml.adapter"
+ schema="pyramid.zcml.IAdapterDirective"
+ handler="pyramid.zcml.adapter"
/>
<meta:directive
name="subscriber"
- schema="repoze.bfg.zcml.ISubscriberDirective"
- handler="repoze.bfg.zcml.subscriber"
+ schema="pyramid.zcml.ISubscriberDirective"
+ handler="pyramid.zcml.subscriber"
/>
<meta:directive
name="utility"
- schema="repoze.bfg.zcml.IUtilityDirective"
- handler="repoze.bfg.zcml.utility"
+ schema="pyramid.zcml.IUtilityDirective"
+ handler="pyramid.zcml.utility"
/>
<meta:directive
name="default_permission"
- schema="repoze.bfg.zcml.IDefaultPermissionDirective"
- handler="repoze.bfg.zcml.default_permission"
+ schema="pyramid.zcml.IDefaultPermissionDirective"
+ handler="pyramid.zcml.default_permission"
/>
</meta:directives>
View
2 pyramid/paster.py
@@ -7,7 +7,7 @@
from paste.script.templates import Template
from paste.util.template import paste_script_template_renderer
-from repoze.bfg.scripting import get_root
+from pyramid.scripting import get_root
class StarterProjectTemplate(Template):
View
22 pyramid/renderers.py
@@ -6,17 +6,17 @@
from zope.deprecation import deprecated
-from repoze.bfg.interfaces import IRendererGlobalsFactory
-from repoze.bfg.interfaces import IRendererFactory
-from repoze.bfg.interfaces import IResponseFactory
-from repoze.bfg.interfaces import ITemplateRenderer
-
-from repoze.bfg.compat import json
-from repoze.bfg.path import caller_package
-from repoze.bfg.settings import get_settings
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.resource import resolve_resource_spec
-from repoze.bfg.decorator import reify
+from pyramid.interfaces import IRendererGlobalsFactory
+from pyramid.interfaces import IRendererFactory
+from pyramid.interfaces import IResponseFactory
+from pyramid.interfaces import ITemplateRenderer
+
+from pyramid.compat import json
+from pyramid.path import caller_package
+from pyramid.settings import get_settings
+from pyramid.threadlocal import get_current_registry
+from pyramid.resource import resolve_resource_spec
+from pyramid.decorator import reify
# API
View
4 pyramid/request.py
@@ -4,7 +4,7 @@
from webob import Request as WebobRequest
-from repoze.bfg.interfaces import IRequest
+from pyramid.interfaces import IRequest
class Request(WebobRequest):
"""
@@ -217,7 +217,7 @@ def add_headers(request, response):
response.headerlist.append((k, v))
request.add_response_callback(add_headers)
-from repoze.bfg.threadlocal import get_current_request as get_request # b/c
+from pyramid.threadlocal import get_current_request as get_request # b/c
get_request # prevent PyFlakes complaints
View
8 pyramid/resource.py
@@ -3,11 +3,11 @@
from zope.interface import implements
-from repoze.bfg.interfaces import IPackageOverrides
+from pyramid.interfaces import IPackageOverrides
-from repoze.bfg.path import package_path
-from repoze.bfg.path import package_name
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.path import package_path
+from pyramid.path import package_name
+from pyramid.threadlocal import get_current_registry
class OverrideProvider(pkg_resources.DefaultProvider):
def __init__(self, module):
View
44 pyramid/router.py
@@ -1,28 +1,28 @@
from zope.interface import implements
from zope.interface import providedBy
-from repoze.bfg.interfaces import IDebugLogger
-from repoze.bfg.interfaces import IExceptionViewClassifier
-from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRootFactory
-from repoze.bfg.interfaces import IRouteRequest
-from repoze.bfg.interfaces import IRouter
-from repoze.bfg.interfaces import IRequestFactory
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import ISettings
-from repoze.bfg.interfaces import ITraverser
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
-
-from repoze.bfg.configuration import make_app # b/c import
-from repoze.bfg.events import ContextFound
-from repoze.bfg.events import NewRequest
-from repoze.bfg.events import NewResponse
-from repoze.bfg.exceptions import NotFound
-from repoze.bfg.request import Request
-from repoze.bfg.threadlocal import manager
-from repoze.bfg.traversal import DefaultRootFactory
-from repoze.bfg.traversal import ModelGraphTraverser
+from pyramid.interfaces import IDebugLogger
+from pyramid.interfaces import IExceptionViewClassifier
+from pyramid.interfaces import IRequest
+from pyramid.interfaces import IRootFactory
+from pyramid.interfaces import IRouteRequest
+from pyramid.interfaces import IRouter
+from pyramid.interfaces import IRequestFactory
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import ISettings
+from pyramid.interfaces import ITraverser
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
+
+from pyramid.configuration import make_app # b/c import
+from pyramid.events import ContextFound
+from pyramid.events import NewRequest
+from pyramid.events import NewResponse
+from pyramid.exceptions import NotFound
+from pyramid.request import Request
+from pyramid.threadlocal import manager
+from pyramid.traversal import DefaultRootFactory
+from pyramid.traversal import ModelGraphTraverser
make_app # prevent pyflakes from complaining
View
4 pyramid/scripting.py
@@ -1,5 +1,5 @@
-from repoze.bfg.request import Request
-from repoze.bfg.interfaces import IRequestFactory
+from pyramid.request import Request
+from pyramid.interfaces import IRequestFactory
def get_root(app, request=None):
""" Return a tuple composed of ``(root, closer)`` when provided a
View
12 pyramid/security.py
@@ -2,13 +2,13 @@
from zope.deprecation import deprecated
-from repoze.bfg.interfaces import IAuthenticationPolicy
-from repoze.bfg.interfaces import IAuthorizationPolicy
-from repoze.bfg.interfaces import ISecuredView
-from repoze.bfg.interfaces import IViewClassifier
+from pyramid.interfaces import IAuthenticationPolicy
+from pyramid.interfaces import IAuthorizationPolicy
+from pyramid.interfaces import ISecuredView
+from pyramid.interfaces import IViewClassifier
-from repoze.bfg.exceptions import Forbidden as Unauthorized # b/c import
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.exceptions import Forbidden as Unauthorized # b/c import
+from pyramid.threadlocal import get_current_registry
Unauthorized # prevent PyFlakes from complaining
View
4 pyramid/settings.py
@@ -2,9 +2,9 @@
from zope.interface import implements
-from repoze.bfg.interfaces import ISettings
+from pyramid.interfaces import ISettings
-from repoze.bfg.threadlocal import get_current_registry
+from pyramid.threadlocal import get_current_registry
class Settings(dict):
""" Deployment settings. Update application settings (usually
View
8 pyramid/static.py
@@ -10,10 +10,10 @@
from zope.interface import implements
-from repoze.bfg.interfaces import IStaticURLInfo
-from repoze.bfg.path import caller_package
-from repoze.bfg.resource import resolve_resource_spec
-from repoze.bfg.url import route_url
+from pyramid.interfaces import IStaticURLInfo
+from pyramid.path import caller_package
+from pyramid.resource import resolve_resource_spec
+from pyramid.url import route_url
class PackageURLParser(StaticURLParser):
""" This probably won't work with zipimported resources """
View
40 pyramid/testing.py
@@ -11,25 +11,25 @@
from zope.interface import Interface
from zope.interface import alsoProvides
-from repoze.bfg.interfaces import IRequest
-from repoze.bfg.interfaces import IRoutesMapper
-from repoze.bfg.interfaces import ISecuredView
-from repoze.bfg.interfaces import IView
-from repoze.bfg.interfaces import IViewClassifier
-from repoze.bfg.interfaces import IViewPermission
-
-from repoze.bfg.configuration import Configurator
-from repoze.bfg.exceptions import Forbidden
-from repoze.bfg.registry import Registry
-from repoze.bfg.security import Allowed
-from repoze.bfg.security import Authenticated
-from repoze.bfg.security import Denied
-from repoze.bfg.security import Everyone
-from repoze.bfg.security import has_permission
-from repoze.bfg.threadlocal import get_current_registry
-from repoze.bfg.threadlocal import manager
-from repoze.bfg.urldispatch import RoutesMapper
-from repoze.bfg.zcml import zcml_configure # API
+from pyramid.interfaces import IRequest
+from pyramid.interfaces import IRoutesMapper
+from pyramid.interfaces import ISecuredView
+from pyramid.interfaces import IView
+from pyramid.interfaces import IViewClassifier
+from pyramid.interfaces import IViewPermission
+
+from pyramid.configuration import Configurator
+from pyramid.exceptions import Forbidden
+from pyramid.registry import Registry
+from pyramid.security import Allowed
+from pyramid.security import Authenticated
+from pyramid.security import Denied
+from pyramid.security import Everyone
+from pyramid.security import has_permission
+from pyramid.threadlocal import get_current_registry
+from pyramid.threadlocal import manager
+from pyramid.urldispatch import RoutesMapper
+from pyramid.zcml import zcml_configure # API
zcml_configure # prevent pyflakes from complaining
@@ -702,7 +702,7 @@ def setUp(registry=None, request=None, hook_zca=True):
# someone may be passing us an esoteric "dummy" registry, and
# the below won't succeed if it doesn't have a registerUtility
# method.
- from repoze.bfg.configuration import DEFAULT_RENDERERS
+ from pyramid.configuration import DEFAULT_RENDERERS
for name, renderer in DEFAULT_RENDERERS:
# Cause the default renderers to be registered because
# in-the-wild test code relies on being able to call
View
2 pyramid/tests/ccbugapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<route
view=".views.rdf_view"
View
2 pyramid/tests/exceptionviewapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<view view=".views.maybe"/>
View
2 pyramid/tests/fixtureapp/another.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<view
view=".views.fixture_view"
View
2 pyramid/tests/fixtureapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<view
view=".views.fixture_view"
View
4 pyramid/tests/fixtureapp/subpackage/yetanother.zcml
@@ -1,8 +1,8 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
- <include package="repoze.bfg.tests.fixtureapp" file="another.zcml"/>
+ <include package="pyramid.tests.fixtureapp" file="another.zcml"/>
</configure>
View
2 pyramid/tests/fixtureapp/views.py
@@ -1,6 +1,6 @@
from zope.interface import Interface
from webob import Response
-from repoze.bfg.exceptions import Forbidden
+from pyramid.exceptions import Forbidden
def fixture_view(context, request):
""" """
View
2 pyramid/tests/grokkedapp/__init__.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view()
def grokked(context, request):
View
2 pyramid/tests/grokkedapp/another.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='another')
def grokked(context, request):
View
2 pyramid/tests/grokkedapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<scan package="."/>
</configure>
View
2 pyramid/tests/grokkedapp/pod/notinit.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='pod_notinit')
def subpackage_notinit(context, request):
View
2 pyramid/tests/grokkedapp/subpackage/__init__.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='subpackage_init')
def subpackage_init(context, request):
View
2 pyramid/tests/grokkedapp/subpackage/notinit.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='subpackage_notinit')
def subpackage_notinit(context, request):
View
2 pyramid/tests/grokkedapp/subpackage/subsubpackage/__init__.py
@@ -1,4 +1,4 @@
-from repoze.bfg.view import bfg_view
+from pyramid.view import bfg_view
@bfg_view(name='subsubpackage_init')
def subpackage_init(context, request):
View
6 pyramid/tests/hybridapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<!-- we want this view to "win" -->
<route
@@ -11,13 +11,13 @@
<!-- .. even though this one has a more specific context -->
<view
view=".views.global_view"
- context="repoze.bfg.traversal.DefaultRootFactory"
+ context="pyramid.traversal.DefaultRootFactory"
/>
<view
name="global2"
view=".views.global2_view"
- context="repoze.bfg.traversal.DefaultRootFactory"
+ context="pyramid.traversal.DefaultRootFactory"
/>
<route
View
2 pyramid/tests/restbugapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes"/>
+ <include package="pyramid.includes"/>
<route
path="/pet"
View
2 pyramid/tests/routesapp/configure.zcml
@@ -1,6 +1,6 @@
<configure xmlns="http://namespaces.repoze.org/bfg">
- <include package="repoze.bfg.includes" />
+ <include package="pyramid.includes" />
<route
path=":id"
View
46 pyramid/tests/test_authentication.py
@@ -2,20 +2,20 @@
class TestRepozeWho1AuthenticationPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import RepozeWho1AuthenticationPolicy
+ from pyramid.authentication import RepozeWho1AuthenticationPolicy
return RepozeWho1AuthenticationPolicy
def _makeOne(self, identifier_name='auth_tkt', callback=None):
return self._getTargetClass()(identifier_name, callback)
def test_class_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyClass(IAuthenticationPolicy, self._getTargetClass())
def test_instance_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne())
def test_authenticated_userid_None(self):
@@ -46,23 +46,23 @@ def callback(identity, request):
self.assertEqual(policy.authenticated_userid(request), 'fred')
def test_effective_principals_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals_userid_only(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest(
{'repoze.who.identity':{'repoze.who.userid':'fred'}})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request),
[Everyone, Authenticated, 'fred'])
def test_effective_principals_userid_and_groups(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest(
{'repoze.who.identity':{'repoze.who.userid':'fred',
'groups':['quux', 'biz']}})
@@ -73,7 +73,7 @@ def callback(identity, request):
[Everyone, Authenticated, 'fred', 'quux', 'biz'])
def test_effective_principals_userid_callback_returns_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest(
{'repoze.who.identity':{'repoze.who.userid':'fred',
'groups':['quux', 'biz']}})
@@ -116,20 +116,20 @@ def test_forget(self):
class TestRemoteUserAuthenticationPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import RemoteUserAuthenticationPolicy
+ from pyramid.authentication import RemoteUserAuthenticationPolicy
return RemoteUserAuthenticationPolicy
def _makeOne(self, environ_key='REMOTE_USER', callback=None):
return self._getTargetClass()(environ_key, callback)
def test_class_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyClass(IAuthenticationPolicy, self._getTargetClass())
def test_instance_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne())
def test_authenticated_userid_None(self):
@@ -143,14 +143,14 @@ def test_authenticated_userid(self):
self.assertEqual(policy.authenticated_userid(request), 'fred')
def test_effective_principals_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest({'REMOTE_USER':'fred'})
policy = self._makeOne()
self.assertEqual(policy.effective_principals(request),
@@ -170,7 +170,7 @@ def test_forget(self):
class TestAutkTktAuthenticationPolicy(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import AuthTktAuthenticationPolicy
+ from pyramid.authentication import AuthTktAuthenticationPolicy
return AuthTktAuthenticationPolicy
def _makeOne(self, callback, cookieidentity, **kw):
@@ -188,12 +188,12 @@ def test_allargs(self):
def test_class_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyClass(IAuthenticationPolicy, self._getTargetClass())
def test_instance_implements_IAuthenticationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthenticationPolicy
+ from pyramid.interfaces import IAuthenticationPolicy
verifyObject(IAuthenticationPolicy, self._makeOne(None, None))
def test_authenticated_userid_no_cookie_identity(self):
@@ -216,22 +216,22 @@ def callback(userid, request):
self.assertEqual(policy.authenticated_userid(request), 'fred')
def test_effective_principals_no_cookie_identity(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
policy = self._makeOne(None, None)
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals_callback_returns_None(self):
- from repoze.bfg.security import Everyone
+ from pyramid.security import Everyone
request = DummyRequest({})
def callback(userid, request):
return None
policy = self._makeOne(callback, {'userid':'fred'})
self.assertEqual(policy.effective_principals(request), [Everyone])
def test_effective_principals(self):
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
request = DummyRequest({})
def callback(userid, request):
return ['group.foo']
@@ -260,7 +260,7 @@ def test_forget(self):
class TestAuthTktCookieHelper(unittest.TestCase):
def _getTargetClass(self):
- from repoze.bfg.authentication import AuthTktCookieHelper
+ from pyramid.authentication import AuthTktCookieHelper
return AuthTktCookieHelper
def _makeOne(self, *arg, **kw):
View
32 pyramid/tests/test_authorization.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class TestACLAuthorizationPolicy(unittest.TestCase):
def setUp(self):
@@ -10,20 +10,20 @@ def tearDown(self):
cleanUp()
def _getTargetClass(self):
- from repoze.bfg.authorization import ACLAuthorizationPolicy
+ from pyramid.authorization import ACLAuthorizationPolicy
return ACLAuthorizationPolicy
def _makeOne(self):
return self._getTargetClass()()
def test_class_implements_IAuthorizationPolicy(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
verifyClass(IAuthorizationPolicy, self._getTargetClass())
def test_instance_implements_IAuthorizationPolicy(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import IAuthorizationPolicy
+ from pyramid.interfaces import IAuthorizationPolicy
verifyObject(IAuthorizationPolicy, self._makeOne())
def test_permits_no_acl(self):
@@ -32,12 +32,12 @@ def test_permits_no_acl(self):
self.assertEqual(policy.permits(context, [], 'view'), False)
def test_permits(self):
- from repoze.bfg.security import Deny
- from repoze.bfg.security import Allow
- from repoze.bfg.security import Everyone
- from repoze.bfg.security import Authenticated
- from repoze.bfg.security import ALL_PERMISSIONS
- from repoze.bfg.security import DENY_ALL
+ from pyramid.security import Deny
+ from pyramid.security import Allow
+ from pyramid.security import Everyone
+ from pyramid.security import Authenticated
+ from pyramid.security import ALL_PERMISSIONS
+ from pyramid.security import DENY_ALL
root = DummyContext()
community = DummyContext(__name__='community', __parent__=root)
blog = DummyContext(__name__='blog', __parent__=community)
@@ -120,8 +120,8 @@ def test_permits(self):
'<No ACL found on any object in model lineage>')
def test_principals_allowed_by_permission_direct(self):
- from repoze.bfg.security import Allow
- from repoze.bfg.security import DENY_ALL
+ from pyramid.security import Allow
+ from pyramid.security import DENY_ALL
context = DummyContext()
acl = [ (Allow, 'chrism', ('read', 'write')),
DENY_ALL,
@@ -133,10 +133,10 @@ def test_principals_allowed_by_permission_direct(self):
self.assertEqual(result, ['chrism'])
def test_principals_allowed_by_permission(self):
- from repoze.bfg.security import Allow
- from repoze.bfg.security import Deny
- from repoze.bfg.security import DENY_ALL
- from repoze.bfg.security import ALL_PERMISSIONS
+ from pyramid.security import Allow
+ from pyramid.security import Deny
+ from pyramid.security import DENY_ALL
+ from pyramid.security import ALL_PERMISSIONS
root = DummyContext(__name__='', __parent__=None)
community = DummyContext(__name__='community', __parent__=root)
blog = DummyContext(__name__='blog', __parent__=community)
View
32 pyramid/tests/test_chameleon_text.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class Base:
def setUp(self):
@@ -21,16 +21,16 @@ def _getTemplatePath(self, name):
return os.path.join(here, 'fixtures', name)
def _registerUtility(self, utility, iface, name=''):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
reg.registerUtility(utility, iface, name=name)
return reg
class TextTemplateRendererTests(Base, unittest.TestCase):
def setUp(self):
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.registry import Registry
+ from pyramid.configuration import Configurator
+ from pyramid.registry import Registry
registry = Registry()
self.config = Configurator(registry=registry)
self.config.begin()
@@ -39,7 +39,7 @@ def tearDown(self):
self.config.end()
def _getTargetClass(self):
- from repoze.bfg.chameleon_text import TextTemplateRenderer
+ from pyramid.chameleon_text import TextTemplateRenderer
return TextTemplateRenderer
def _makeOne(self, *arg, **kw):
@@ -48,13 +48,13 @@ def _makeOne(self, *arg, **kw):
def test_instance_implements_ITemplate(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
path = self._getTemplatePath('minimal.txt')
verifyObject(ITemplateRenderer, self._makeOne(path))
def test_class_implements_ITemplate(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
verifyClass(ITemplateRenderer, self._getTargetClass())
def test_template_reified(self):
@@ -65,7 +65,7 @@ def test_template_reified(self):
self.assertEqual(template, instance.__dict__['template'])
def test_template_with_ichameleon_translate(self):
- from repoze.bfg.interfaces import IChameleonTranslate
+ from pyramid.interfaces import IChameleonTranslate
def ct(): pass
self.config.registry.registerUtility(ct, IChameleonTranslate)
minimal = self._getTemplatePath('minimal.txt')
@@ -91,7 +91,7 @@ def test_template_with_reload_templates(self):
self.assertEqual(template.auto_reload, True)
def test_template_with_emptydict(self):
- from repoze.bfg.interfaces import ISettings
+ from pyramid.interfaces import ISettings
self.config.registry.registerUtility({}, ISettings)
minimal = self._getTemplatePath('minimal.txt')
instance = self._makeOne(minimal)
@@ -128,7 +128,7 @@ def test_implementation(self):
class RenderTemplateTests(Base, unittest.TestCase):
def _callFUT(self, name, **kw):
- from repoze.bfg.chameleon_text import render_template
+ from pyramid.chameleon_text import render_template
return render_template(name, **kw)
def test_it(self):
@@ -139,7 +139,7 @@ def test_it(self):
class RenderTemplateToResponseTests(Base, unittest.TestCase):
def _callFUT(self, name, **kw):
- from repoze.bfg.chameleon_text import render_template_to_response
+ from pyramid.chameleon_text import render_template_to_response
return render_template_to_response(name, **kw)
def test_minimal(self):
@@ -155,19 +155,19 @@ def test_iresponsefactory_override(self):
from webob import Response
class Response2(Response):
pass
- from repoze.bfg.interfaces import IResponseFactory
+ from pyramid.interfaces import IResponseFactory
self._registerUtility(Response2, IResponseFactory)
minimal = self._getTemplatePath('minimal.txt')
result = self._callFUT(minimal)
self.failUnless(isinstance(result, Response2))
class GetRendererTests(Base, unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.chameleon_text import get_renderer
+ from pyramid.chameleon_text import get_renderer
return get_renderer(name)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
class Dummy:
template = object()
def implementation(self): pass
@@ -180,11 +180,11 @@ def rf(spec):
class GetTemplateTests(Base, unittest.TestCase):
def _callFUT(self, name):
- from repoze.bfg.chameleon_text import get_template
+ from pyramid.chameleon_text import get_template
return get_template(name)
def test_it(self):
- from repoze.bfg.interfaces import IRendererFactory
+ from pyramid.interfaces import IRendererFactory
class Dummy:
template = object()
def implementation(self):
View
32 pyramid/tests/test_chameleon_zpt.py
@@ -1,6 +1,6 @@
import unittest
-from repoze.bfg.testing import cleanUp
+from pyramid.testing import cleanUp
class Base(object):
def setUp(self):
@@ -15,15 +15,15 @@ def _getTemplatePath(self, name):
return os.path.join(here, 'fixtures', name)
def _registerUtility(self, utility, iface, name=''):
- from repoze.bfg.threadlocal import get_current_registry
+ from pyramid.threadlocal import get_current_registry
reg = get_current_registry()
reg.registerUtility(utility, iface, name=name)
return reg
class ZPTTemplateRendererTests(Base, unittest.TestCase):
def setUp(self):
- from repoze.bfg.configuration import Configurator
- from repoze.bfg.registry import Registry
+ from pyramid.configuration import Configurator
+ from pyramid.registry import Registry
registry = Registry()
self.config = Configurator(registry=registry)
self.config.begin()
@@ -32,7 +32,7 @@ def tearDown(self):
self.config.end()
def _getTargetClass(self):
- from repoze.bfg.chameleon_zpt import ZPTTemplateRenderer
+ from pyramid.chameleon_zpt import ZPTTemplateRenderer
return ZPTTemplateRenderer
def _makeOne(self, *arg, **kw):
@@ -41,13 +41,13 @@ def _makeOne(self, *arg, **kw):
def test_instance_implements_ITemplate(self):
from zope.interface.verify import verifyObject
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
path = self._getTemplatePath('minimal.pt')
verifyObject(ITemplateRenderer, self._makeOne(path))
def test_class_implements_ITemplate(self):
from zope.interface.verify import verifyClass
- from repoze.bfg.interfaces import ITemplateRenderer
+ from pyramid.interfaces import ITemplateRenderer
verifyClass(ITemplateRenderer, self._getTargetClass())
def test_call(self):
@@ -66,7 +66,7 @@ def test_template_reified(self):
self.assertEqual(template, instance.__dict__['template'])
def test_template_with_ichameleon_translate(self):
- from repoze.bfg.interfaces import IChameleonTranslate
+ from pyramid.interfaces import IChameleonTranslate
def ct(): pass
self.config.registry.registerUtility(ct, IChameleonTranslate)
minimal = self._getTemplatePath('minimal.pt')
@@ -92,7 +92,7 @@ def test_template_with_reload_templates(self):