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

All Samples(11)  |  Call(5)  |  Derive(0)  |  Import(6)

        def flash_properties_to_dict(propertysheet, portal_url):
    items = dict()

    if not portal_url.endswith('/'):
        portal_url += '/'
    # build python representation of properties first
    for key, value in propertysheet.propertyItems():
        if key.startswith('param/'):
            # process param/ properties only
            if isinstance(value, str):
                new_value = value.replace('${portal_path}', portal_url)
                new_value = new_value.replace('${portal_url}', portal_url)
            else:
                new_value = value
            # key name is param/src - there must be 'src' only in result dict
            items[key[6:]] = new_value
    return items
        


src/c/o/collective.flowplayer-4.1/src/collective/flowplayer/browser/view.py   collective.flowplayer(Download)
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName
from collective.flowplayer.utils import (
    properties_to_dict,
    flash_properties_to_dict
    def flash_properties_as_dict(self):
        portal_url = self.portal_state().portal_url()
        return flash_properties_to_dict(self.flowplayer_properties,
                                        portal_url)
 

src/p/l/plonetheme.colorcontext-0.9/plonetheme/colorcontext/browser/flowplayer_view.py   plonetheme.colorcontext(Download)
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName
from collective.flowplayer.utils import properties_to_dict, \
                                        flash_properties_to_dict
 
    def flash_properties_as_dict(self):
        portal_url = self.portal_state().portal_url()
        return flash_properties_to_dict(self.flowplayer_properties, 
                                        portal_url)
 

src/p/l/plonetheme.laboral-3.11/plonetheme/laboral/browser/laboral_file_view.py   plonetheme.laboral(Download)
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName
from collective.flowplayer.utils import properties_to_dict, \
                                        flash_properties_to_dict
 
    def flash_properties_as_dict(self):
        portal_url = self.portal_state().portal_url()
        return flash_properties_to_dict(self.flowplayer_properties, 
                                        portal_url)
 

src/v/2/v2.theme-5.3/v2/theme/browser/v2_view.py   v2.theme(Download)
from Products.Five.browser import BrowserView
from Products.CMFCore.utils import getToolByName
from collective.flowplayer.utils import properties_to_dict, \
                                        flash_properties_to_dict
 
    def flash_properties_as_dict(self):
        portal_url = self.portal_state().portal_url()
        return flash_properties_to_dict(self.flowplayer_properties, 
                                        portal_url)
 

src/c/o/collective.flowplayer-4.1/src/collective/flowplayer/tests/test_utils.py   collective.flowplayer(Download)
# -*- coding: utf-8 -*-
from OFS.PropertyManager import PropertyManager
 
from collective.flowplayer.utils import properties_to_dict
from collective.flowplayer.utils import flash_properties_to_dict
    def test_parsing_flash_props(self):
        parsed = flash_properties_to_dict(self.props, 'http://localhost')
        self.assertEqual(len(parsed.keys()), 2)  # src, wmode
        self.assertEqual(parsed['src'], 'flowplayer.swf')
        self.assertEqual(parsed['wmode'], 'opaque')

src/c/o/collective.flowplayer-4.1/src/collective/flowplayer/tests/test_migration.py   collective.flowplayer(Download)
# -*- coding: utf-8 -*-
from collective.flowplayer.utils import properties_to_dict
from collective.flowplayer.utils import flash_properties_to_dict
from collective.flowplayer.testing import \
    COLLECTIVE_FLOWPLAYER_INTEGRATION_TESTING