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


Python GLApiCache.get方法代码示例

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


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

示例1: test_set

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
 def test_set(self):
     self.assertTrue("passante_di_professione" not in GLApiCache.memory_cache_dict)
     pdp_it = yield GLApiCache.get("passante_di_professione", "it", self.mario, "come", "una", "catapulta!")
     self.assertTrue("passante_di_professione" in GLApiCache.memory_cache_dict)
     self.assertTrue(pdp_it == "come una catapulta!")
     yield GLApiCache.set("passante_di_professione", "it", "ma io ho visto tutto!")
     self.assertTrue("passante_di_professione" in GLApiCache.memory_cache_dict)
     pdp_it = yield GLApiCache.get("passante_di_professione", "it", self.mario, "already", "cached")
     self.assertEqual(pdp_it, "ma io ho visto tutto!")
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:11,代码来源:test_cache.py

示例2: test_get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
 def test_get(self):
     self.assertTrue("passante_di_professione" not in GLApiCache.memory_cache_dict)
     pdp_it = yield GLApiCache.get("passante_di_professione", "it", self.mario, "come", "una", "catapulta!")
     pdp_en = yield GLApiCache.get("passante_di_professione", "en", self.mario, "like", "a", "catapult!")
     self.assertTrue("passante_di_professione" in GLApiCache.memory_cache_dict)
     self.assertTrue("it" in GLApiCache.memory_cache_dict['passante_di_professione'])
     self.assertTrue("en" in GLApiCache.memory_cache_dict['passante_di_professione'])
     self.assertEqual(pdp_it, "come una catapulta!")
     self.assertEqual(pdp_en, "like a catapult!")
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:11,代码来源:test_cache.py

示例3: get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
    def get(self):
        """
        Get the Ahmia.fi descriptor
        """
        node_info = yield GLApiCache.get("node", self.request.language, serialize_node, self.request.language)

        if node_info["ahmia"]:
            ret = yield GLApiCache.get("ahmia", self.request.language, serialize_ahmia, self.request.language)

            self.finish(ret)
        else:  # in case of disabled option we return 404
            self.set_status(404)
            self.finish()
开发者ID:corvolino,项目名称:GlobaLeaks,代码行数:15,代码来源:node.py

示例4: get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
    def get(self):
        """
        Get the ahmia.fi descriptor
        """
        node_info = yield GLApiCache.get('node', self.request.language,
                                         serialize_node, self.request.language)

        if node_info['ahmia']:
            ret = yield GLApiCache.get('ahmia', self.request.language,
                                       serialize_ahmia, self.request.language)

            self.write(ret)
        else:  # in case of disabled option we return 404
            self.set_status(404)
开发者ID:comradekingu,项目名称:GlobaLeaks,代码行数:16,代码来源:node.py

示例5: get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
 def get(self):
     """
     Get all the receivers.
     """
     ret = yield GLApiCache.get('receivers', self.request.language,
                                get_public_receiver_list, self.request.language)
     self.finish(ret)
开发者ID:anticorruzione,项目名称:openwhistleblowing,代码行数:9,代码来源:node.py

示例6: get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
    def get(self, lang):
        self.set_header('Content-Type', 'application/json')

        l10n = yield GLApiCache.get('l10n', self.request.language,
                                    get_l10n, self.request.language)

        self.write(l10n)
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:9,代码来源:l10n.py

示例7: test_invalidate

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
 def test_invalidate(self):
     self.assertTrue("passante_di_professione" not in GLApiCache.memory_cache_dict)
     pdp_it = yield GLApiCache.get("passante_di_professione", "it", self.mario, "come", "una", "catapulta!")
     self.assertTrue("passante_di_professione" in GLApiCache.memory_cache_dict)
     self.assertEqual(pdp_it, "come una catapulta!")
     yield GLApiCache.invalidate("passante_di_professione")
     self.assertTrue("passante_di_professione" not in GLApiCache.memory_cache_dict)
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:9,代码来源:test_cache.py

示例8: get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
    def get(self):
        """
        Return a list of all the fields templates available.

        :return: the list of field templates registered on the node.
        :rtype: list
        """
        response = yield GLApiCache.get('fieldtemplates', self.request.language,
                                        get_fieldtemplate_list, self.request.language, self.request.request_type)

        self.write(response)
开发者ID:comradekingu,项目名称:GlobaLeaks,代码行数:13,代码来源:field.py

示例9: get

# 需要导入模块: from globaleaks.rest.apicache import GLApiCache [as 别名]
# 或者: from globaleaks.rest.apicache.GLApiCache import get [as 别名]
    def get(self):
        """
        Return all the questionnaires.

        Parameters: None
        Response: adminQuestionnaireList
        Errors: None
        """
        response = yield GLApiCache.get('questionnaires', self.request.language,
                                        get_questionnaire_list, self.request.language)

        self.write(response)
开发者ID:Taipo,项目名称:GlobaLeaks,代码行数:14,代码来源:questionnaire.py


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