• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python publishing.PublishHandler类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tardis.apps.ands_register.publishing.PublishHandler的典型用法代码示例。如果您正苦于以下问题:Python PublishHandler类的具体用法?Python PublishHandler怎么用?Python PublishHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: get_authors

 def get_authors(self, experiment):
     phandler = PublishHandler(experiment.id)
     authors = phandler.custom_authors()
     if authors:
         return "* " + "\n* ".join(authors)
     else:
         return self.get_investigator_list(experiment)
开发者ID:TheGoodRob,项目名称:mytardis,代码行数:7,代码来源:schemarifcsprovider.py


示例2: testCanPublishPublicAndPrivate

 def testCanPublishPublicAndPrivate(self):
     # (experiment public: True, access type: private) -> True
     self.e1.public = True
     self.publish_data[self.access_type_key] = "private"
     ph = PublishHandler(self.e1.id, create=True)
     ph.update(self.publish_data)
     self.assertTrue(self.provider.can_publish(self.e1))
开发者ID:aaryani,项目名称:aa-migration-test1,代码行数:7,代码来源:test_rifcsprovider.py


示例3: testCanPublishPublicAndUnpublished

 def testCanPublishPublicAndUnpublished(self):
     # (experiment public: True, access type: unpublished) -> False
     self.e1.public = True
     self.publish_data[self.access_type_key] = "unpublished"
     ph = PublishHandler(self.e1.id, create=True)
     ph.update(self.publish_data)
     self.assertTrue(self.provider.can_publish(self.e1))
开发者ID:aaryani,项目名称:aa-migration-test1,代码行数:7,代码来源:test_rifcsprovider.py


示例4: get_description

 def get_description(self, experiment):
     from tardis.apps.ands_register.publishing import PublishHandler        
     phandler = PublishHandler(experiment.id) 
     desc = phandler.custom_description()
     if not desc:
         desc = experiment.description
     return self.format_desc(desc)
开发者ID:IntersectAustralia,项目名称:dc2c,代码行数:7,代码来源:dc2crifcsprovider.py


示例5: testCanPublishNoProject

 def testCanPublishNoProject(self):
     self.e1.public = True
     self.e1.save()
     ph = PublishHandler(self.e1.id, create=True)
     ph.update(self.publish_data)
     self.assertTrue(self.provider.can_publish(self.e1))    
     self.p1.delete()
     self.assertFalse(self.provider.can_publish(self.e1))    
开发者ID:IntersectAustralia,项目名称:dc2c,代码行数:8,代码来源:test_rifcsprovider.py


示例6: get_description

 def get_description(self, experiment):
     phandler = PublishHandler(experiment.id) 
     desc = phandler.custom_description()
     if not desc:
         desc = experiment.description
     if self._is_html_formatted(desc):
         desc = html2text(desc)
     desc = desc.strip()
     return desc
开发者ID:ryanbraganza,项目名称:mytardis,代码行数:9,代码来源:schemarifcsprovider.py


示例7: get_description

 def get_description(self, experiment):
     from tardis.apps.ands_register.publishing import PublishHandler        
     phandler = PublishHandler(experiment.id) 
     desc = phandler.custom_description()
     if not desc:
         # We do not want the abstract to be available in the description when
         # no custom description is available
         desc = ""
     return super(AnstoRifCsProvider, self).format_desc(desc)
开发者ID:nhauser,项目名称:mecat-ansto,代码行数:9,代码来源:anstorifcsprovider.py


示例8: testGetDescriptionCustom

 def testGetDescriptionCustom(self):
     ph = PublishHandler(self.e1.id, create=True)
     self.publish_data[self.custom_description_key] = self.random_custom_description
     ph.update(self.publish_data)
     self.assertEquals(self.random_custom_description, ph.custom_description())
     
     self.assertEquals(ph.custom_description(), self.random_custom_description)
     description = self.provider.get_description(self.e1)
     
     self.assertEquals(description, self.random_custom_description)
开发者ID:ANSTO,项目名称:mecat-ansto,代码行数:10,代码来源:test_rifcsprovider.py


示例9: get_description

 def get_description(self, experiment):
     phandler = PublishHandler(experiment.id)
     desc = phandler.custom_description()
     if not desc:
         desc = experiment.description
     return self.format_desc(desc)
开发者ID:TheGoodRob,项目名称:mytardis,代码行数:6,代码来源:schemarifcsprovider.py


示例10: get_url

 def get_url(self, experiment, server_url):
    """Only public experiments can show the direct link to the experiment
    in the rif-cs"""
    phandler = PublishHandler(experiment.id)
    if experiment.public or (phandler.access_type() == publishing.PUBLIC):
        return "%s/experiment/view/%s/" % (server_url, experiment.id)        
开发者ID:ryanbraganza,项目名称:mytardis,代码行数:6,代码来源:schemarifcsprovider.py


示例11: can_publish

 def can_publish(self, experiment):
     phandler = PublishHandler(experiment.id) 
     return experiment.public or (phandler.access_type() is not publishing.UNPUBLISHED)
开发者ID:ryanbraganza,项目名称:mytardis,代码行数:3,代码来源:schemarifcsprovider.py


示例12: testCanPublishPublicAndPublished

 def testCanPublishPublicAndPublished(self):
     # (experiment public: True, access type: published) -> True
     self.e1.public = True
     ph = PublishHandler(self.e1.id, create=True)
     ph.update(self.publish_data)
     self.assertTrue(self.provider.can_publish(self.e1))
开发者ID:aaryani,项目名称:aa-migration-test1,代码行数:6,代码来源:test_rifcsprovider.py


示例13: testCanPublishNotPublicAndMediated

 def testCanPublishNotPublicAndMediated(self):
     # (experiment public: False, access type: mediated) -> FALSE
     self.publish_data[self.access_type_key] = "mediated"
     ph = PublishHandler(self.e1.id, create=True)
     ph.update(self.publish_data)
     self.assertFalse(self.provider.can_publish(self.e1))
开发者ID:aaryani,项目名称:aa-migration-test1,代码行数:6,代码来源:test_rifcsprovider.py


示例14: testCanPublishNotPublicAndPublic

 def testCanPublishNotPublicAndPublic(self):
     # (experiment public: False, access type: public) -> FALSE
     ph = PublishHandler(self.e1.id, create=True)
     ph.update(self.publish_data)
     self.assertFalse(self.provider.can_publish(self.e1))
开发者ID:aaryani,项目名称:aa-migration-test1,代码行数:5,代码来源:test_rifcsprovider.py


示例15: can_publish

 def can_publish(self, experiment):
     phandler = PublishHandler(experiment.id) 
     if (not experiment.public) or (phandler.access_type() is publishing.UNPUBLISHED):
         return False
     return True
开发者ID:aaryani,项目名称:aa-migration-test1,代码行数:5,代码来源:schemarifcsprovider.py


示例16: _is_mediated

 def _is_mediated(self, experiment):
     import tardis.apps.ands_register.publishing as publishing
     from tardis.apps.ands_register.publishing import PublishHandler      
     phandler = PublishHandler(experiment.id) 
     return phandler.access_type() == publishing.MEDIATED
开发者ID:IntersectAustralia,项目名称:dc2c,代码行数:5,代码来源:dc2crifcsprovider.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python config_reader.Configuration类代码示例发布时间:2022-05-27
下一篇:
Python testtools.TestTools类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap