diff options
| author | Chris McDonough <chrism@plope.com> | 2011-09-29 03:04:03 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-09-29 03:04:03 -0400 |
| commit | bb69a069791074dd8557da60a857a701d370a5c4 (patch) | |
| tree | 99eef0a8e4a0bd6279ed3e986ac516d08e3f6ea2 | |
| parent | bdfb877ab4c7c2ea9f1e9fe6aacd1865612c86cc (diff) | |
| download | pyramid-bb69a069791074dd8557da60a857a701d370a5c4.tar.gz pyramid-bb69a069791074dd8557da60a857a701d370a5c4.tar.bz2 pyramid-bb69a069791074dd8557da60a857a701d370a5c4.zip | |
experimental use of glue
| -rw-r--r-- | pyramid/paster.py | 22 | ||||
| -rw-r--r-- | pyramid/scaffolds/__init__.py | 24 | ||||
| -rw-r--r-- | setup.py | 12 |
3 files changed, 16 insertions, 42 deletions
diff --git a/pyramid/paster.py b/pyramid/paster.py index c9c356a92..1c06ca79b 100644 --- a/pyramid/paster.py +++ b/pyramid/paster.py @@ -3,18 +3,8 @@ import sys from code import interact import zope.deprecation - -try: - from paste.deploy import loadapp -except ImportError: # pragma: no cover - def loadapp(*arg, **kw): - raise NotImplementedError - -try: - from paste.script.command import Command -except ImportError: # pragma: no cover - class Command: - pass +from paste.deploy import loadapp +from glue.command import Command from pyramid.interfaces import IMultiView from pyramid.interfaces import ITweens @@ -121,7 +111,7 @@ class PShellCommand(PCommand): Example:: - $ paster pshell myapp.ini#main + $ glue pshell myapp.ini#main .. note:: If you do not point the loader directly at the section of the ini file containing your :app:`Pyramid` application, the @@ -294,7 +284,7 @@ class PRoutesCommand(PCommand): Example:: - $ paster proutes myapp.ini#main + $ glue proutes myapp.ini#main """ summary = "Print all URL dispatch routes related to a Pyramid application" @@ -358,7 +348,7 @@ class PViewsCommand(PCommand): Example:: - $ paster proutes myapp.ini#main url + $ glue proutes myapp.ini#main url """ summary = "Print all views in an application that might match a URL" @@ -599,7 +589,7 @@ class PTweensCommand(PCommand): Example:: - $ paster ptweens myapp.ini#main + $ glue ptweens myapp.ini#main """ summary = "Print all tweens related to a Pyramid application" diff --git a/pyramid/scaffolds/__init__.py b/pyramid/scaffolds/__init__.py index 673f22e21..8661038bf 100644 --- a/pyramid/scaffolds/__init__.py +++ b/pyramid/scaffolds/__init__.py @@ -1,22 +1,16 @@ +import binascii import os -from pyramid.compat import print_ +from pyramid.compat import ( + print_, + native_ + ) -try: - from paste.script.templates import Template -except ImportError: # pragma: no cover - class Template: - pass - -try: - from paste.util.template import paste_script_template_renderer -except ImportError: # pragma: no cover - def paste_script_template_renderer(): - pass +from glue.template import Template class PyramidTemplate(Template): def pre(self, command, output_dir, vars): - vars['random_string'] = os.urandom(20).encode('hex') + vars['random_string'] = native_(binascii.hexlify(os.urandom(20))) package_logger = vars['package'] if package_logger == 'root': # Rename the app logger in the rare case a project is named 'root' @@ -34,20 +28,16 @@ class PyramidTemplate(Template): class StarterProjectTemplate(PyramidTemplate): _template_dir = 'starter' summary = 'pyramid starter project' - template_renderer = staticmethod(paste_script_template_renderer) class ZODBProjectTemplate(PyramidTemplate): _template_dir = 'zodb' summary = 'pyramid ZODB starter project' - template_renderer = staticmethod(paste_script_template_renderer) class RoutesAlchemyProjectTemplate(PyramidTemplate): _template_dir = 'routesalchemy' summary = 'pyramid SQLAlchemy project using url dispatch (no traversal)' - template_renderer = staticmethod(paste_script_template_renderer) class AlchemyProjectTemplate(PyramidTemplate): _template_dir = 'alchemy' summary = 'pyramid SQLAlchemy project using traversal' - template_renderer = staticmethod(paste_script_template_renderer) @@ -39,15 +39,9 @@ install_requires=[ 'zope.deprecation >= 3.5.0', # py3 compat 'venusian >= 1.0a1', # ``onerror`` 'translationstring >= 0.4', # py3 compat + 'glue', ] -if not PY3: - install_requires.extend([ - 'Paste > 1.7', # temp version pin to prevent PyPi install failure :-( - 'PasteDeploy', - 'PasteScript >= 1.7.4', # "here" in logging fileConfig - ]) - tests_require = install_requires + [ 'WebTest >= 1.3.1', # py3 compat 'virtualenv', @@ -90,12 +84,12 @@ setup(name='pyramid', tests_require = tests_require, test_suite="pyramid.tests", entry_points = """\ - [paste.paster_create_template] + [glue.create_template] pyramid_starter=pyramid.scaffolds:StarterProjectTemplate pyramid_zodb=pyramid.scaffolds:ZODBProjectTemplate pyramid_routesalchemy=pyramid.scaffolds:RoutesAlchemyProjectTemplate pyramid_alchemy=pyramid.scaffolds:AlchemyProjectTemplate - [paste.paster_command] + [glue.command] pshell=pyramid.paster:PShellCommand proutes=pyramid.paster:PRoutesCommand pviews=pyramid.paster:PViewsCommand |
