Did I find the right examples for you? yes no Crawl my project Python Jobs
All Samples(8) | Call(0) | Derive(0) | Import(8)
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.client-1.0.8/ftw/bridge/client/request.py ftw.bridge.client(Download)
from ftw.bridge.client.interfaces import IBridgeConfig from ftw.bridge.client.interfaces import IBridgeRequest from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER from ftw.bridge.client.utils import json from zope.app.component.hooks import getSite
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):
response_data = StringIO(response_data.replace( PORTAL_URL_PLACEHOLDER, public_url)) response = urllib.addinfourl(
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/browser/favorite.py ftw.bridge.client(Download)
from ftw.bridge.client.interfaces import IBridgeRequest from ftw.bridge.client.interfaces import MAINTENANCE_ERROR_MESSAGE from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER from zope.component import getMultiAdapter from zope.component import getUtility
portal_url = getToolByName(self.context, 'portal_url')() + '/' relative_path = state.view_url()[len(portal_url):] return ''.join((PORTAL_URL_PLACEHOLDER, relative_path))
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/utils.py ftw.bridge.client(Download)
from Products.CMFCore.utils import getToolByName from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER try: import json
""" portal_url = getToolByName(obj, 'portal_url')() + '/' return obj.absolute_url().replace(portal_url, PORTAL_URL_PLACEHOLDER)
""" portal_url = getToolByName(brain, 'portal_url')() + '/' return brain.getURL().replace(portal_url, PORTAL_URL_PLACEHOLDER)
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/tests/test_watcher_feed_view.py ftw.bridge.client(Download)
from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER from ftw.bridge.client.testing import EXAMPLE_CONTENT_LAYER from ftw.bridge.client.utils import json from plone.uuid.interfaces import IUUID from unittest2 import TestCase
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/tests/test_watcher_ajax_view.py ftw.bridge.client(Download)
from Products.CMFCore.utils import getToolByName from ftw.bridge.client.browser import watcher from ftw.bridge.client.exceptions import MaintenanceError from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER from ftw.bridge.client.portlets.watcher import IWatcherPortlet
title=u'Feed folder', details_url=u'%sfeed-folder/@@watcher-recently-modified' % ( PORTAL_URL_PLACEHOLDER), items=[ dict(title=u'The page with uml\xe4uts', url=u'%sfeed-folder/page' % PORTAL_URL_PLACEHOLDER,
dict(title=u'Feed folder', url=u'%sfeed-folder' % PORTAL_URL_PLACEHOLDER, modified=folder.modified().strftime(dt_format), portal_type=u'Folder',
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/tests/test_utils.py ftw.bridge.client(Download)
from Products.CMFCore.utils import getToolByName from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER from ftw.bridge.client.testing import EXAMPLE_CONTENT_LAYER from ftw.bridge.client.utils import get_brain_url from ftw.bridge.client.utils import get_object_url
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/tests/test_request.py ftw.bridge.client(Download)
from ftw.bridge.client.interfaces import IBrainRepresentation from ftw.bridge.client.interfaces import IBridgeRequest from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER from ftw.bridge.client.request import replace_placeholder_in_data from ftw.bridge.client.testing import BRIDGE_CONFIG_LAYER
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,)}
src/f/t/ftw.bridge.client-1.0.8/ftw/bridge/client/tests/test_favorite.py ftw.bridge.client(Download)
from AccessControl import SecurityManagement from AccessControl.users import SimpleUser from Products.CMFCore.utils import getToolByName from Products.statusmessages.interfaces import IStatusMessage from ftw.bridge.client.interfaces import PORTAL_URL_PLACEHOLDER
def test_requests_bridge(self): favorite_url = '%sfeed-folder/page' % PORTAL_URL_PLACEHOLDER bridge_url = 'http://bridge/proxy/dashboard/@@add-favorite' self._expect_request(url=bridge_url,
# typesUseViewActionInListings. favorite_url = '%sfile/view' % PORTAL_URL_PLACEHOLDER bridge_url = 'http://bridge/proxy/dashboard/@@add-favorite'