Ñò ÆŸIc@sÜdZddkZddkZddkZddkZddklZddklZddk l Z l Z ddk l Z ddkZddkZddkZddd d d gZeieƒZd d „Zd„ZeeiiedƒƒZeeiiedƒƒZeeiiedƒƒZd„Zed„Zed„Zd„Z d e!fd„ƒYZ"de!fd„ƒYZ#de#fd„ƒYZ$de fd„ƒYZ%de%fd„ƒYZ&defd„ƒYZ'dS(s™Paste Template and Pylons utility functions PylonsTemplate is a Paste Template sub-class that configures the source directory and default plug-ins for a new Pylons project. The minimal template a more minimal template with less additional directories and layout. The functions used in this module are to assist Pylons in creating new projects, and handling deprecation warnings for moved Pylons functions. iÿÿÿÿN(tasbool(t Installer(tTemplatetvar(tpaste_script_template_renderertAttribSafeContextObjt ContextObjt PylonsContexttclass_name_from_module_nametcall_wsgi_applications pylons.i18ncCsd||fS(NsYThe %s function has moved to %s, please update your import statements to reflect the move((tnametmoved_to((s//usr/lib/python2.6/site-packages/pylons/util.pyt func_movescsR‡‡fd†}yˆi|_Wntj onXdˆˆif|_|S(Ncs tiˆtdƒˆ||ŽS(Ni(twarningstwarntDeprecationWarning(targstkargs(tfunctmessage(s//usr/lib/python2.6/site-packages/pylons/util.pytdeprecated_method%ss%s %s(t__name__t TypeErrort__doc__(RRR((RRs//usr/lib/python2.6/site-packages/pylons/util.pyt deprecated$stget_langtset_langt_cOsddk}|ii||ŽS(sVDeprecated: Use the logging module instead. Log a message to the output log. iÿÿÿÿN(tpylons.helpersthelperstlog(Rtkwargstpylons((s//usr/lib/python2.6/site-packages/pylons/util.pyR5s cCsi|otidtdƒntiiddƒ}|p+|iddƒdjo|d}qen|S(s6Deprecated: Use environ.get('SCRIPT_NAME', '') insteadsXThe get_prefix function is deprecated, please use environ.get('SCRIPT_NAME', '') insteaditprefixtt SCRIPT_NAME(R RRR tconfigtget(tenvironRR!((s//usr/lib/python2.6/site-packages/pylons/util.pyt get_prefix=s c s¼g‰g‰d‡‡‡fd†}|||ƒ}ˆ pˆo=zˆi|ƒWdt|dƒo|iƒnXˆ}nˆoˆdˆd|ˆdfSˆdˆd|fSdS(s± Call the given WSGI application, returning ``(status_string, headerlist, app_iter)`` Be sure to call ``app_iter.close()`` if it's there. If catch_exc_info is true, then returns ``(status_string, headerlist, app_iter, exc_info)``, where the fourth item may be None, but won't be if there was an exception. If you don't do this and there was an exception, the exception will be raised directly. csH|dj o$ˆ o|d|d|d‚n|||gˆ(ˆiS(Niii(tNonetappend(tstatustheaderstexc_info(tcatch_exc_infotoutputtcaptured(s//usr/lib/python2.6/site-packages/pylons/util.pytstart_responseYsNtcloseiii(R(textendthasattrR1(t applicationR&R-R0tapp_iter((R-R.R/s//usr/lib/python2.6/site-packages/pylons/util.pyR Js  cCsI|iddƒidƒ}dig}|D]}||iƒq,~ƒS(s“Takes a module name and returns the name of the class it defines. If the module name contains dashes, they are replaced with underscores. Example:: >>> class_name_from_module_name('with-dashes') 'WithDashes' >>> class_name_from_module_name('with_underscores') 'WithUnderscores' >>> class_name_from_module_name('oneword') 'Oneword' t-RR"(treplacetsplittjointtitle(t module_nametwordst_[1]tw((s//usr/lib/python2.6/site-packages/pylons/util.pyRlscBseZdZRS(s Pylons context object All the Pylons Stacked Object Proxies are also stored here, for use in generators and async based operation where the globals can't be used. This object is attached in :class:`~pylons.controllers.core.WSGIController` instances as :attr:`~WSGIController._py_object`. For example:: class MyController(WSGIController): def index(self): pyobj = self._py_object return "Environ is %s" % pyobj.request.environ (Rt __module__R(((s//usr/lib/python2.6/site-packages/pylons/util.pyRscBseZdZd„ZRS(syThe :term:`tmpl_context` object, with strict attribute access (raises an Exception when the attribute does not exist)c Csög}|iiƒD]-\}}|idƒp|||fqq~}|iƒg}xd|D]\\}}t|ƒ}t|ƒdjo|d d|d}n|id||fƒqaWd|ii|ii t t |ƒƒdi |ƒfS( NRiFi<s...iûÿÿÿs %s=%ss<%s.%s at %s%s>t,( t__dict__titemst startswithtsorttreprtlenR)t __class__R?RthextidR9(tselfR=R tvaluetattrstpartst value_repr((s//usr/lib/python2.6/site-packages/pylons/util.pyt__repr__˜s *     (RR?RRO(((s//usr/lib/python2.6/site-packages/pylons/util.pyR•scBseZdZd„ZRS(snThe :term:`tmpl_context` object, with lax attribute access ( returns '' when the attribute does not exist)cCs?yti||ƒSWn$tj otid|ƒdSXdS(Ns@No attribute called %s found on c object, returning empty stringR"(tobjectt__getattribute__tAttributeErrort pylons_logtdebug(RJR ((s//usr/lib/python2.6/site-packages/pylons/util.pyt __getattr__­s  (RR?RRU(((s//usr/lib/python2.6/site-packages/pylons/util.pyRªstPylonsTemplatecBsqeZdZeeƒZdZddgZeddddƒed d de ƒgZ d d d dgZ d„Z RS(R stemplates/default_projectsPylons application templatet PasteScripttPylonsttemplate_engines)mako/genshi/jinja2/etc: Template languagetdefaulttmakot sqlalchemys0True/False: Include SQLAlchemy 0.5 configurationt descriptiontauthort author_emailturlcCsè|d}|djo d}n||d<|idtiiƒ}|djodddf|d   (RR?Rwt use_cheetahRƒR†(((s//usr/lib/python2.6/site-packages/pylons/util.pyRyés((RtloggingRR Rtpaste.deploy.convertersRtpaste.script.appinstallRtpaste.script.templatesRRttempitaRR tpylons.configurationt pylons.i18nt__all__t getLoggerRRSR Rti18nRRRRtTrueR'RwR RRPRRRRVRxRy(((s//usr/lib/python2.6/site-packages/pylons/util.pyt s:             "  *