m $Ec@sdZdZdZdZdZdZdZdZdZd Z d d Z d Z d Z dfdYZ dS(s Products.PythonScripts.standard: Utility functions and classes The functions and classes in this module are available from Python-based scripts, DTML, and Page Templates. cCsdS(s4 Show a numeric value with a dollar symbol. N((tnumber((tC/data/zmath/zope/lib/python/Products/PythonScripts/help/standard.pyt whole_dollars scCsdS(sK Show a numeric value with a dollar symbol and two decimal places. N((R((Rtdollars_and_centsscCsdS(s Convert a string in structured-text format to HTML. See Also "Structured-Text Rules":http://dev.zope.org/Members/jim/StructuredTextWiki/StructuredTextNGRules N((ts((Rtstructured_textscCsdS(s Convert single quotes to pairs of single quotes. This is needed to safely include values in Standard Query Language (SQL) strings. N((R((Rt sql_quotescCsdS(s Convert characters that have special meaning in HTML to HTML character entities. See Also "Python 'cgi' module":http://www.python.org/doc/current/lib/Functions_in_cgi_module.html 'escape' function. N((R((Rt html_quote#s cCsdS(s Convert characters that have special meaning in URLS to HTML character entities using decimal values. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'quote' function. N((R((Rt url_quote/s cCsdS(s  Like url_quote but also replace blank space characters with '+'. This is needed for building query strings in some cases. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'quote_plus' function. N((R((Rturl_quote_plus;s cCsdS(s Convert HTML %xx character entities into the characters they represent. (Undoes the affects of url_quote). See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'unquote' function. N((R((Rt url_unquoteGs cCsdS(s Like url_unquote but also replace '+' characters with blank spaces. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'unquote_plus' function. N((R((Rturl_unquote_plusSs icCsdS(s@ Convert a mapping object (such as a dictionary) or a sequence of two-element tuples to a URL encoded query string. Useful for generating query strings programmatically. See Also "Python 'urllib' module":http://www.python.org/doc/current/lib/module-urllib.html 'urlencode' function. N((tquerytdoseq((Rt urlencode^s cCsdS(sZ Convert newlines and carriage-return and newline combinations to break tags. N((R((Rt newline_to_brjscCsdS(s Insert commas every three digits to the left of a decimal point in values containing numbers. For example, the value, "12000 widgets" becomes "12,000 widgets". N((R((Rtthousand_commaspstDTMLcBs&tZdZdZehdZRS(s< DTML - temporary, security-restricted DTML objects cKsdS(s Create a DTML object with source text and keyword variables. The source text defines the DTML source content. The optinal keyword arguments define variables. N((tsourcetkw((Rt__init__|scKsdS(s Render the DTML. To accomplish its task, DTML often needs to resolve various names into objects. For example, when the code <dtml-var spam> is executed, the DTML engine tries to resolve the name 'spam'. In order to resolve names, you must be pass a namespace to the DTML. This can be done several ways: * By passing a 'client' object - If the argument 'client' is passed, then names are looked up as attributes on the argument. * By passing a 'REQUEST' mapping - If the argument 'REQUEST' is passed, then names are looked up as items on the argument. If the object is not a mapping, an TypeError will be raised when a name lookup is attempted. * By passing keyword arguments -- names and their values can be passed as keyword arguments to the Method. The namespace given to a DTML object is the composite of these three methods. You can pass any number of them or none at all. Names will be looked up first in the keyword argument, next in the client and finally in the mapping. N((tclienttREQUESTR((Rtcalls(t__name__t __module__t__doc__RtNoneR(((RRws  N(RRRRRRRR R R RRRR( RRRRRR RRRR RR R((Rt?s