Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(0)  |  Derive(0)  |  Import(5)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/p/r/Products.statusmessages-4.0/Products/statusmessages/adapter.py   Products.statusmessages(Download)
from zope.interface import implements
 
from Products.statusmessages import STATUSMESSAGEKEY
from Products.statusmessages.message import decode
from Products.statusmessages.message import Message
        annotations = IAnnotations(context)
 
        old = annotations.get(STATUSMESSAGEKEY,
                              context.cookies.get(STATUSMESSAGEKEY))
        value = _encodeCookieValue(text, type, old=old)
        context.response.setCookie(STATUSMESSAGEKEY, value, path='/')
        annotations[STATUSMESSAGEKEY] = value

src/n/u/NuPlone-1.4.0/plonetheme/nuplone/adapter.py   NuPlone(Download)
from webhelpers.html.builder import literal
from Products.statusmessages import adapter
from Products.statusmessages import STATUSMESSAGEKEY
from htmllaundry import cleaners 
from htmllaundry.utils import sanitize 
        context = self.context
        annotations = IAnnotations(context)
        msgs = annotations.get(STATUSMESSAGEKEY,
                                context.cookies.get(STATUSMESSAGEKEY))
        msgs = msgs and adapter._decodeCookieValue(msgs) or []
        # are sloppy).
        if self.context.response.getStatus() not in (301, 302, 304):
            context.cookies[STATUSMESSAGEKEY] = None
            context.response.expireCookie(STATUSMESSAGEKEY, path='/')
            annotations[STATUSMESSAGEKEY] = None

src/p/l/plone.app.kss-1.8.0/plone/app/kss/plonekssview.py   plone.app.kss(Download)
    ZOPE2_12 = False
 
from Products.statusmessages import STATUSMESSAGEKEY
from Products.statusmessages.adapter import _decodeCookieValue
 
    def issueAllPortalMessages(self):
        if hasattr(self.request.RESPONSE, 'cookies'):
            cookie = self.request.RESPONSE.cookies.get(STATUSMESSAGEKEY)
            if cookie:
                encodedstatusmessages = cookie['value']
            for msg in statusmessages:
                self.getCommandSet('plone').issuePortalMessage(msg)
            self.request.RESPONSE.expireCookie(STATUSMESSAGEKEY, path='/')
 

src/f/t/ftw.quota-1.0/ftw/quota/handlers.py   ftw.quota(Download)
from Acquisition import aq_parent, aq_inner
from Products.Archetypes.interfaces import IBaseObject
from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import getToolByName
from Products.statusmessages import STATUSMESSAGEKEY
    request = parent.REQUEST
    annotations = IAnnotations(request)
    request.cookies[STATUSMESSAGEKEY] = None
    annotations[STATUSMESSAGEKEY] = None
 

src/p/l/plone.app.contentrules-3.0.7/plone/app/contentrules/tests/test_action_notify.py   plone.app.contentrules(Download)
from plone.app.contentrules.tests.base import ContentRulesTestCase
 
from Products.statusmessages import STATUSMESSAGEKEY
from Products.statusmessages.interfaces import IStatusMessage
from Products.statusmessages.adapter import _decodeCookieValue
 
        status = IStatusMessage(self.app.REQUEST)
        new_cookies = self.app.REQUEST.RESPONSE.cookies[STATUSMESSAGEKEY]
        messages = _decodeCookieValue(new_cookies['value'])
        self.assertEqual(1, len(messages))