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


Python Folder.title方法代码示例

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


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

示例1: test_store_properties

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
    def test_store_properties(self):
        conn = self.db.open()
        try:
            app = conn.root()['Application']
            f = Folder()
            f.id = 'Holidays'
            f.title = 'Holiday Calendar'
            app._setObject(f.id, f, set_owner=0)
            transaction.commit()

            f._setProperty('pi', 3.14, 'float')
            f._setProperty('stuff', ['a', 'bc', 'd'], 'lines')
            transaction.commit()

            conn2 = self.db.open()
            try:
                app = conn2.root()['Application']
                self.assert_(hasattr(app, 'Holidays'))
                got = 0
                for k, v in app.Holidays.propertyItems():
                    if k == 'title':
                        got += 1
                        self.assertEqual(v, 'Holiday Calendar')
                    elif k == 'pi':
                        got += 1
                        self.assertEqual(v, 3.14)
                    elif k == 'stuff':
                        got += 1
                        self.assertEqual(tuple(v), ('a', 'bc', 'd'))
                self.assertEqual(got, 3)
            finally:
                conn2.close()

        finally:
            conn.close()
开发者ID:goschtl,项目名称:zope,代码行数:37,代码来源:zope2testbase.py

示例2: _makeSite

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
    def _makeSite( self, title="Don't care" ):

        site = Folder()
        site._setId( 'site' )
        site.title = title

        self.app._setObject( 'site', site )
        return self.app._getOb( 'site' )
开发者ID:dtgit,项目名称:dtedu,代码行数:10,代码来源:test_tool.py

示例3: manage_addFolder

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
def manage_addFolder(dispatcher, id,
        itemClass,
        sessionName='',
        title='',
        REQUEST=None):
    """Adds a new Folder object with id *id*.
    """
    id = str(id)
    ob = Folder(id)
    ob.title = str(title)
    ob.item_class = _my_import(itemClass)
    ob.session_name = str(sessionName)
    dispatcher._setObject(id, ob)
    ob = dispatcher._getOb(id)
    if REQUEST is not None:
        return dispatcher.manage_main(dispatcher, REQUEST, update_menu=1)
开发者ID:affinitic,项目名称:collective.rope,代码行数:18,代码来源:folder.py

示例4: test_store_selection_properties

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
    def test_store_selection_properties(self):
        conn = self.db.open()
        try:
            app = conn.root()['Application']
            f = Folder()
            f.id = 'Holidays'
            f.title = 'Holiday Calendar'
            app._setObject(f.id, f, set_owner=0)
            transaction.commit()

            f._setProperty('choices', ['alpha', 'omega', 'delta'], 'lines')
            f._setProperty('greek', 'choices', 'multiple selection')
            f._setProperty('hebrew', 'choices', 'selection')
            f.greek = ['alpha', 'omega']
            f.hebrew = 'alpha'
            transaction.commit()

            conn2 = self.db.open()
            try:
                app = conn2.root()['Application']
                self.assert_(hasattr(app, 'Holidays'))
                got = 0
                for k, v in app.Holidays.propertyItems():
                    if k == 'greek':
                        got += 1
                        self.assertEqual(tuple(v), ('alpha', 'omega'))
                    if k == 'hebrew':
                        got += 1
                        self.assertEqual(v, 'alpha')
                self.assertEqual(got, 2)
                # Be sure the select_variable got restored.
                dict = app.Holidays.propdict()
                self.assertEqual(dict['greek']['select_variable'], 'choices')
                self.assertEqual(dict['hebrew']['select_variable'], 'choices')
            finally:
                conn2.close()

        finally:
            conn.close()
开发者ID:goschtl,项目名称:zope,代码行数:41,代码来源:zope2testbase.py

示例5: refreshDB

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
    def refreshDB(self):
        """ All actions to take when refreshing a DB (after import for
        instance).
        """
        logger.info('Refreshing database ' + self.id)
        report = []

        self.setStatus(_("Refreshing design"))
        # migrate to current version
        messages = migrate(self)
        for msg in messages:
            report.append(msg)
            logger.info(msg)

        # check folders
        if not hasattr(self, 'resources'):
            resources = Folder('resources')
            resources.title = 'resources'
            self._setObject('resources', resources)
        msg = 'Resources folder OK'
        report.append(msg)
        logger.info(msg)
        if not hasattr(self, 'scripts'):
            scripts = Folder('scripts')
            scripts.title = 'scripts'
            self._setObject('scripts', scripts)
        self.cleanFormulaScripts()
        msg = 'Scripts folder OK and clean'
        report.append(msg)
        logger.info(msg)

        # clean portal_catalog
        portal_catalog = self.portal_catalog
        catalog_entries = portal_catalog.search({
            'portal_type': ['PlominoDocument'],
            'path': '/'.join(self.getPhysicalPath())
        })
        for d in catalog_entries:
            portal_catalog.uncatalog_object(d.getPath())
        msg = 'Portal catalog clean'
        report.append(msg)
        logger.info(msg)

        # create new blank index (without fulltext)
        index = PlominoIndex(FULLTEXT=False).__of__(self)
        index.no_refresh = True
        msg = 'New index created'
        report.append(msg)
        logger.info(msg)

        # declare all indexed fields
        for f_obj in self.getForms():
            for f in f_obj.getFormFields():
                if f.to_be_indexed:
                    index.createFieldIndex(
                        f.id,
                        f.field_type,
                        indextype=f.index_type,
                        fieldmode=f.field_mode)
        logger.info('Field indexing initialized')

        # declare all the view formulas and columns index entries
        for v_obj in self.getViews():
            index.createSelectionIndex(
                'PlominoViewFormula_' + v_obj.id)
            for c in v_obj.getColumns():
                v_obj.declareColumn(c.id, c, index=index)
        # add fulltext if needed
        if self.fulltextIndex:
            index.createFieldIndex('SearchableText', 'RICHTEXT')
        logger.info('Views indexing initialized')

        # re-index documents
        start_time = DateTime().toZone(TIMEZONE)
        msg = self.reindexDocuments(index)
        report.append(msg)

        # Re-indexed documents that have changed since indexing started
        msg = self.reindexDocuments(index, changed_since=start_time)
        report.append(msg)
        index.no_refresh = False

        # destroy the old index and rename the new one
        self.manage_delObjects("plomino_index")
        self._setObject('plomino_index', index.aq_base)
        msg = 'Old index removed and replaced'
        report.append(msg)
        logger.info(msg)

        # refresh portal_catalog
        if self.indexInPortal:
            self.refreshPortalCatalog()

        # update Plone workflow state and role permissions
        self.refreshWorkflowState()
        self.refreshPlominoRolesPermissions()

        self.setStatus(_("Ready"))
        return report
开发者ID:plomino,项目名称:Plomino,代码行数:101,代码来源:design.py

示例6: __call__

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
 def __call__(self, id, title):
     archive = Folder(id)
     archive.title = title
     directlyProvides(archive, IListArchive)
     return archive
开发者ID:socialplanning,项目名称:opencore-listen,代码行数:7,代码来源:factories.py

示例7: __call__

# 需要导入模块: from OFS.Folder import Folder [as 别名]
# 或者: from OFS.Folder.Folder import title [as 别名]
 def __call__(self, id, title, **kwargs):
     folder = Folder(id)
     folder.title = title
     return folder
开发者ID:socialplanning,项目名称:opencore-listen,代码行数:6,代码来源:__init__.py


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