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

All Samples(2)  |  Call(0)  |  Derive(0)  |  Import(2)
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/f/t/ftw.bridge.proxy-1.1.1/ftw/bridge/proxy/proxy.py   ftw.bridge.proxy(Download)
from ftw.bridge.proxy.interfaces import IClientManager
from ftw.bridge.proxy.interfaces import IProxy
from ftw.bridge.proxy.interfaces import PORTAL_URL_PLACEHOLDER
from pyramid.httpexceptions import HTTPServiceUnavailable
from pyramid.interfaces import IRequest
def replace_placeholder_in_data(data, public_url):
    if isinstance(data, types.StringTypes):
        return data.replace(PORTAL_URL_PLACEHOLDER, public_url)
 
    elif isinstance(data, (types.DictType, NestedMultiDict)):
 
        body = response.raw.read().replace(
            PORTAL_URL_PLACEHOLDER,
            self._get_target_client().get_public_url())
 

src/f/t/ftw.bridge.proxy-1.1.1/ftw/bridge/proxy/tests/test_proxy.py   ftw.bridge.proxy(Download)
from StringIO import StringIO
from ftw.bridge.proxy.interfaces import IClientManager
from ftw.bridge.proxy.interfaces import IProxy
from ftw.bridge.proxy.interfaces import PORTAL_URL_PLACEHOLDER
from ftw.bridge.proxy.proxy import Proxy
    def test_replace_placeholder_in_data(self):
        data = {
            'foo': u'bar %s baz' % PORTAL_URL_PLACEHOLDER,
            'bar': 2,
            'baz': {
                'sub': PORTAL_URL_PLACEHOLDER},
            'barbaz': [PORTAL_URL_PLACEHOLDER],
            'foobar': (PORTAL_URL_PLACEHOLDER,)}