Did I find the right examples for you? yes no

All Samples(3)  |  Call(0)  |  Derive(0)  |  Import(3)
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/c/o/collective.contact.plonegroup-0.2/src/collective/contact/plonegroup/browser/settings.py   collective.contact.plonegroup(Download)
from Products.statusmessages.interfaces import IStatusMessage
from .. import _
from ..config import ORGANIZATIONS_REGISTRY, FUNCTIONS_REGISTRY, PLONEGROUP_ORG
 
 
        registry = getUtility(IRegistry)
        changes = False
        if event.record.fieldName == 'organizations' and registry[FUNCTIONS_REGISTRY]:
            old_set = set(event.oldValue)
            new_set = set(event.newValue)
                obj = uuidToObject(uid)
                full_title = obj.get_full_title(separator=' - ', first_index=1)
                for fct_dic in registry[FUNCTIONS_REGISTRY]:
                    group_name = "%s_%s" % (uid, fct_dic['fct_id'])
                    if addOrModifyGroup(group_name, full_title, fct_dic['fct_title']):
    registry = getUtility(IRegistry)
    changes = False
    for dic in registry[FUNCTIONS_REGISTRY]:
        full_title = organization.get_full_title(separator=' - ', first_index=1)
        group_name = "%s_%s" % (uid, dic['fct_id'])
    # if no function given, use all functions
    if not functions:
        functions = [fct_dic['fct_id'] for fct_dic in registry[FUNCTIONS_REGISTRY]]
    for uid in registry[ORGANIZATIONS_REGISTRY]:
        for fct_id in functions:

src/c/o/collective.contact.plonegroup-0.2/src/collective/contact/plonegroup/setuphandlers.py   collective.contact.plonegroup(Download)
# -*- coding: utf-8 -*-
from zope.component import getUtility
from plone.registry.interfaces import IRegistry
from config import ORGANIZATIONS_REGISTRY, FUNCTIONS_REGISTRY
 
    if registry[ORGANIZATIONS_REGISTRY] is None:
        registry[ORGANIZATIONS_REGISTRY] = []
    if registry[FUNCTIONS_REGISTRY] is None:
        registry[FUNCTIONS_REGISTRY] = []
 

src/c/o/collective.contact.plonegroup-0.2/src/collective/contact/plonegroup/tests/test_settings.py   collective.contact.plonegroup(Download)
from plone.registry.interfaces import IRegistry
from collective.contact.plonegroup.testing import IntegrationTestCase
from ..config import ORGANIZATIONS_REGISTRY, FUNCTIONS_REGISTRY, PLONEGROUP_ORG
from collective.contact.plonegroup.browser import settings
 
        self.assertEquals(d1s1_d_group.getProperty('title'), 'Department 1 - Service 1 (Director)')
        # Changing function title
        self.registry[FUNCTIONS_REGISTRY] = [{'fct_title': u'Directors', 'fct_id': u'director'},
                                             {'fct_title': u'Worker', 'fct_id': u'worker'}]
        d1_d_group = api.group.get(groupname='%s_director' % organizations[0])
        self.assertIn('%s_worker' % last_uid, group_ids)
        # Adding new function
        newValue = self.registry[FUNCTIONS_REGISTRY] + [{'fct_title': u'Chief', 'fct_id': u'chief'}]
        self.registry[FUNCTIONS_REGISTRY] = newValue
        group_ids = [group.id for group in api.group.get_groups() if '_' in group.id]