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
 
 
            if old_set.difference(new_set):
                changes = True
        elif event.record.fieldName == 'functions' and registry[ORGANIZATIONS_REGISTRY]:
            old_set = new_set = set()
            if event.oldValue:
            registry = getUtility(IRegistry)
            for (new_id, new_title) in add_set:
                for uid in registry[ORGANIZATIONS_REGISTRY]:
                    obj = uuidToObject(uid)
                    full_title = obj.get_full_title(separator=' - ', first_index=1)
    registry = getUtility(IRegistry)
    # when an organization is removed (and its content), we check if it is used in plonegroup configuration
    if IObjectRemovedEvent.providedBy(event) and organization.UID() in registry[ORGANIZATIONS_REGISTRY]:
        smi = IStatusMessage(organization.REQUEST)
        smi.addStatusMessage(_('You cannot delete this item !'), type='error')
        orga = brain.getObject()
        orga_uid = orga.UID()
        if orga_uid in registry[ORGANIZATIONS_REGISTRY]:
            if addOrModifyOrganizationGroups(orga, orga_uid):
                changes = True

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
 
    registry = getUtility(IRegistry)
    # Initialize the registry content if nothing is stored
    if registry[ORGANIZATIONS_REGISTRY] is None:
        registry[ORGANIZATIONS_REGISTRY] = []
    if registry[FUNCTIONS_REGISTRY] is None:

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
 
    def test_detectContactPlonegroupChange(self):
        """Test if group creation works correctly"""
        group_ids = [group.id for group in api.group.get_groups()]
        organizations = self.registry[ORGANIZATIONS_REGISTRY]
        for uid in organizations:
        own_orga['department2'].invokeFactory('organization', 'service2', title='Service 2')
        # append() method on the registry doesn't trigger the event. += too
        newValue = self.registry[ORGANIZATIONS_REGISTRY] + [own_orga['department2']['service2'].UID()]
        self.registry[ORGANIZATIONS_REGISTRY] = newValue
        group_ids = [group.id for group in api.group.get_groups()]
        last_uid = self.registry[ORGANIZATIONS_REGISTRY][-1]