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


Python Pit.set方法代码示例

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


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

示例1: main

# 需要导入模块: from pit import Pit [as 别名]
# 或者: from pit.Pit import set [as 别名]
def main():
    gmail = Pit.get('gmail', {'require' : {
                'user' : 'Gmail account name',
                'pass' : 'password for Gmail account',
                'fullcount' : '0'
                }})

    kayac = Pit.get('kayac', {'require' : {
                'user' : 'im.kayac.com account name',
                'pass' : 'password for im.kayac.com account'
                }})

    d = feedparser.parse( GMAILATOM % (gmail['user'], gmail['pass']) )
    

    if int(d.feed.fullcount) == int(gmail['fullcount']):
        sys.exit(0)
    
    elif int(d.feed.fullcount) > int(gmail['fullcount']):
        for e in d.entries:
            title = e.title
            author = e.author
            message = '%s <%s> [%[email protected]]' % (title, author, gmail['user'])
            r = notify(message, kayac['user'], kayac['pass'])

        if r['result'] != 'posted':
            print 'failed', r
            sys.exit(2)

    Pit.set('gmail', {'data' : {
                'user' : gmail['user'],
                'pass' : gmail['pass'],
                'fullcount' : str(d.feed.fullcount)}})
开发者ID:ymotongpoo,项目名称:0x7d8,代码行数:35,代码来源:gmail2kayac.py

示例2: test_set_get

# 需要导入模块: from pit import Pit [as 别名]
# 或者: from pit.Pit import set [as 别名]
    def test_set_get(self):
        Pit.set("test", {'data':{'username':'foo','password':'bar'}})
        self.assertEqual("foo", Pit.get("test")["username"] )
        self.assertEqual("bar", Pit.get("test")["password"] )

        Pit.set("test2", {'data' : {"username":"foo2","password":"bar2"}})
        self.assertEqual( "foo2", Pit.get("test2")["username"])
        self.assertEqual( "bar2", Pit.get("test2")["password"])
        
        Pit.set("test", {'data' : {"username":"foo","password":"bar"}})
        self.assertEqual( "foo", Pit.get("test")["username"])
        self.assertEqual( "bar", Pit.get("test")["password"])

        self.assertEqual( "foo", Pit.set("test",{'data':{"username":"foo","password":"bar"}})["username"])
开发者ID:yoshiori,项目名称:pit,代码行数:16,代码来源:test.py

示例3: set

# 需要导入模块: from pit import Pit [as 别名]
# 或者: from pit.Pit import set [as 别名]
def set():
	Pit.set('test1', dict(data=data))
开发者ID:a-yasui,项目名称:atysPy,代码行数:4,代码来源:pit_test.py

示例4:

# 需要导入模块: from pit import Pit [as 别名]
# 或者: from pit.Pit import set [as 别名]
#!/usr/bin/env python
#-*- coding:utf8 -*-

from pit import Pit
conf = Pit.set('fb_app_info', {'require':{'app_id':'','consumer_secret':''}})


开发者ID:tell-k,项目名称:code-snippets,代码行数:7,代码来源:setup.py


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