Ñò ¯›—Ic @ s. d Z d d k Z d d k Z d d k Z d d k Z d d k Z d d k l Z l Z d d k l Z l Z d d k l Z d d k l Z d d k Z d d k i Z d d d g Z d „ Z e d „ Z d „ Z d „ Z d „ Z d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( se Paster Commands, for use with paster in your project .. highlight:: bash The following commands are made available via paster utilizing setuptools points discovery. These can be used from the command line when the directory is the Pylons project. Commands available: ``controller`` Create a Controller and accompanying functional test ``restcontroller`` Create a REST Controller and accompanying functional test ``shell`` Open an interactive shell with the Pylons app loaded Example usage:: ~/sample$ paster controller account Creating /Users/ben/sample/sample/controllers/account.py Creating /Users/ben/sample/sample/tests/functional/test_account.py ~/sample$ .. admonition:: How it Works :command:`paster` is a command line script (from the PasteScript package) that allows the creation of context sensitive commands. :command:`paster` looks in the current directory for a ``.egg-info`` directory, then loads the ``paster_plugins.txt`` file. Using setuptools entry points, :command:`paster` looks for functions registered with setuptools as :func:`paste.paster_command`. These are defined in the entry_points block in each packages :file:`setup.py` module. This same system is used when running :command:`paster create` to determine what templates are available when creating new projects. iÿÿÿÿN( t loadappt appconfig( t Commandt BadCommand( t FileOp( t paste_script_template_renderert ControllerCommandt RestControllerCommandt ShellCommandc C s- y t | ƒ t SWn t j o t SXd S( sg Attempt to __import__ the specified package/module, returning True when succeeding, otherwise FalseN( t __import__t Truet ImportErrort False( t name( ( s3 /usr/lib/python2.6/site-packages/pylons/commands.pyt can_import: s c C se t } y t | d ƒ WnF t j o&