当前位置: 首页>>代码示例>>Python>>正文


Python IAnnotations.items方法代码示例

本文整理汇总了Python中zope.annotation.interfaces.IAnnotations.items方法的典型用法代码示例。如果您正苦于以下问题:Python IAnnotations.items方法的具体用法?Python IAnnotations.items怎么用?Python IAnnotations.items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在zope.annotation.interfaces.IAnnotations的用法示例。


在下文中一共展示了IAnnotations.items方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __call__

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
    def __call__(self):
        query = {'portal_type': 'opengever.meeting.proposal'}
        for proposal in self.objects(query, 'Fix proposal history'):

            history = IAnnotations(proposal).get('object_history', OOBTree())

            for key, value in history.items():
                if value.get('name') and not value.get('history_type'):
                    value.update({'history_type': value.get('name')})
开发者ID:4teamwork,项目名称:opengever.core,代码行数:11,代码来源:upgrade.py

示例2: test_outputfilter_scaled

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
 def test_outputfilter_scaled(self, browser):
     page = browser.login().visit(self.obj)
     annos = IAnnotations(self.obj)
     scales = annos.items()[1][1].keys()
     for scale in scales:
         if isinstance(scale, str):
             scale_uid = scale
     image = page.css('.fileListing img')[1].node
     self.assertEqual("http://nohost/plone/file/@@images/" + scale_uid + ".jpeg",
                      image.attrib['src'])
开发者ID:4teamwork,项目名称:ftw.file,代码行数:12,代码来源:test_outputfilter.py

示例3: get_options

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
 def get_options(self):
     nav_root = self.context.restrictedTraverse(getNavigationRoot(self.context))
     options = IAnnotations(nav_root).get('onegov.customstyles', {})
     styles = []
     for key, value in options.items():
         if value and key.startswith('css.'):
             styles.append('$%s: %s;' % (key.replace('css.',''),
                                         value))
         if value and key == 'custom_scss':
             styles.append(value)
     return '\n'.join(styles)
开发者ID:seantis,项目名称:plonetheme.onegov,代码行数:13,代码来源:customstyles.py

示例4: _get

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
 def _get(kls, obj):
     data = {}
     try:
         annotations = IAnnotations(obj)
     except TypeError:
         return {}
     for key, annotation in annotations.items():
         if key.startswith('Archetypes.storage') or \
                 key in _skipped_annotations or \
                 key.startswith('plone.portlets'):
             # skip because this data should be handled elsewhere
             continue
         data[key] = annotation
     return data
开发者ID:collective,项目名称:wildcard.migrator,代码行数:16,代码来源:content.py

示例5: __call__

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
    def __call__(self):

        draftAnnotations = IAnnotations(self.draft)
        targetAnnotations = IAnnotations(self.target)

        for key, value in draftAnnotations.items():
            if key.startswith(ANNOTATIONS_KEY_PREFIX):
                targetAnnotations[key] = value

        annotationsDeleted = getattr(
            self.draft, '_proxyAnnotationsDeleted', set())

        for key in annotationsDeleted:
            if key.startswith(ANNOTATIONS_KEY_PREFIX) and key in targetAnnotations:  # noqa
                del targetAnnotations[key]
开发者ID:plone,项目名称:plone.app.tiles,代码行数:17,代码来源:drafting.py

示例6: export

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
    def export(self):
        """\
        Generate and save structure, delete all objects, rebuild.
        """

        if hasattr(self, 'exported'):
            return self.exported

        cur = self.export_source()
        # we need the actual data, now.
        self.exported = list(self._export(cur))

        # delete all existing annotations
        notes = IAnnotations(cur)
        for key, obj in notes.items():
            if IExposureFileNote.providedBy(obj):
                del notes[key]

        return self.exported
开发者ID:PMR2,项目名称:pmr2.app,代码行数:21,代码来源:browser.py

示例7: get_recipient_settings

# 需要导入模块: from zope.annotation.interfaces import IAnnotations [as 别名]
# 或者: from zope.annotation.interfaces.IAnnotations import items [as 别名]
def get_recipient_settings(megaphone, recipient_type):
    data = IAnnotations(megaphone).get(ANNOTATION_KEY, {}).get('recipients', {})
    return [(id, settings) for (id, settings) in data.items()
                           if settings.get('recipient_type', 'standard') == recipient_type]
开发者ID:collective,项目名称:collective.megaphone,代码行数:6,代码来源:__init__.py


注:本文中的zope.annotation.interfaces.IAnnotations.items方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。