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

Python web.start函数代码示例

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

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



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

示例1: process

def process(queue) :
    url = '/zong'
    get = json.loads(queue)
    print(get)
    if 'text' in get and 'sender' in get:
        num = get['number']	
        print(num)
        #op = 'zong'
        subtxt = get['text']
        #subtxt =subtxt.replace("'",'')
       # meta_data = get['meta_data']
       # smpp = ''meta_data.split('?')
       # print('smpp - split length' + len(smpp))
        append_to_log('/mmatcher/sms/log/' + url + '.log', get['sender'] + ' - ' + get['text'])					
        print(subtxt)
        subtxt = subtxt.lower()
        if subtxt == 'sub m' :
                subtxt = subtxt.replace('sub m','sub bus')
        elif subtxt == 'sub off' :
                subtxt = subtxt.replace('sub off','unsub')
        elif subtxt == 'sub free off' :
                subtxt = subtxt.replace('sub free off','unsub')
        elif subtxt == 'off sub' :
                subtxt = subtxt.replace('off sub','unsub')
        elif subtxt == 'sub' :
                subtxt = subtxt.replace('sub','sub bus')
        print(subtxt)                         
        body = web.start(subtxt, get['sender'].replace('+',''), url.replace('/',''))        
        logBody = body                
        filename = datetime.now().strftime('/log/' + url + '_sms_usage-%Y%m%U%d.log')
        append_to_log('/mmatcher/sms' + filename, get['sender'] + ' !|! ' + subtxt + ' !|! ' +  logBody + ' !|! '+num)
    else:
            body = 'The command was not recognized. To sell, send SELL<space> your item to 289. To buy, send BUY<space>your item to 289. Send H to 289 for help.'
    smsc.send('zong',get['sender'].replace('+',''), body)
开发者ID:madjoint,项目名称:MM-SMS,代码行数:34,代码来源:request_handler.py


示例2: start

def start(xml):
	from mmodules import web
	txt, usr = decode(xml)
	sms = web.start(txt, usr, 'clickatell')
	xml = encode(usr, sms)
	if xml:
		out = send(xml)
	return usr, txt, sms
开发者ID:madjoint,项目名称:MM-SMS,代码行数:8,代码来源:clickatell.py


示例3: test_024_add_interest

	def test_024_add_interest(self):
		self.assertEqual(web.start('no tst1', test_user), 'Your interest I1 is added and currently has no matches. Matches will arrive on SMS later.')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例4: test_121_delete_interests2

	def test_121_delete_interests2(self):
		rng = range(1, 10)
		self.assertEqual(web.start(''.join(['d{}|'.format(x) for x in rng])[:-1], test_user2).split('\n'),
						['Interest {} has been deleted.'.format(x) for x in rng])
开发者ID:madjoint,项目名称:MM-SMS,代码行数:4,代码来源:tests.py


示例5: test_113_list_interests

	def test_113_list_interests(self):
		self.assertEqual(web.start('i', test_user), 'I1:buying unittestingtestcases(9)')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例6: test_111_add_interests2

	def test_111_add_interests2(self):
		rng = range(1, 10)
		self.assertEqual(web.start(''.join('selling unittestingtestcases for {}|'.format(x+10) for x in rng)[:-1], test_user2).split('\n'),
						['Your interest I{} is added and currently has 1 match. More matches will arrive on SMS later.'.format(x) for x in rng])
开发者ID:madjoint,项目名称:MM-SMS,代码行数:4,代码来源:tests.py


示例7: test_098_list_matches

	def test_098_list_matches(self):
		rng = [10,9,7,5,3,1]
		self.assertEqual(set(re.sub(r'I1M\d0?:', 'I1M?:', web.start('i1', test_user)).split('\n')),
						{'I1M?:selling unittestingtestcases for {}'.format(x) for x in rng})
开发者ID:madjoint,项目名称:MM-SMS,代码行数:4,代码来源:tests.py


示例8: test_095_add_interest2

	def test_095_add_interest2(self):
		self.assertEqual(web.start('selling unittestingtestcases for 10', test_user2), 'Your interest I2 is added and currently has 1 match. More matches will arrive on SMS later.')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例9: test_064_no_matches

	def test_064_no_matches(self):
		self.assertEqual(web.start('i2', test_user), 'There is no interest I2.\nYour interests are:\nI1:buying unittestingtestcases')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例10: test_061_add_interest

	def test_061_add_interest(self):
		self.assertEqual(web.start('a1 buying unittestingtestcases', test_user), 'Your interest I1 is added with 1 day validity. It currently has no matches. Matches will arrive on SMS later.')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例11: test_043_add_interest

	def test_043_add_interest(self):
		self.assertEqual(web.start('a0 tst', test_user), 'Your interest I7 is added with 0 days validity. It currently has no matches. Matches will arrive on SMS later.')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例12: test_041_delete_interest

	def test_041_delete_interest(self):
		self.assertEqual(web.start('d3|d7', test_user), 'Interest 3 has been deleted.\nInterest 7 has been deleted.')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例13: test_032_list_interests

	def test_032_list_interests(self):
		self.assertEqual(set(web.start('i', test_user).split('\n')),
						{'I{}:no tst{}'.format(x, x) for x in range(14,0,-1)})
开发者ID:madjoint,项目名称:MM-SMS,代码行数:3,代码来源:tests.py


示例14: test_031_add_interests

	def test_031_add_interests(self):
		rng = range(2, 15)
		self.assertEqual(web.start(''.join('no tst{}|'.format(x) for x in rng)[:-1], test_user).split('\n'),
						['Your interest I{} is added and currently has no matches. Matches will arrive on SMS later.'.format(x) for x in rng])
开发者ID:madjoint,项目名称:MM-SMS,代码行数:4,代码来源:tests.py


示例15: test_02_list_interests

	def test_02_list_interests(self):
		self.assertEqual(web.start('i', test_user), 'I1:no tst1')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例16: test_084_list_interests

	def test_084_list_interests(self):
		self.assertEqual(web.start('i', test_user2), 'I1:selling unittestingtestcases for 1(1)')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例17: test_092_list_interests2

	def test_092_list_interests2(self):
		self.assertEqual(set(web.start('i', test_user2).split('\n')),
						{'I{}:selling unittestingtestcases for {}(1)'.format(x, x) for x in [9,7,5,3,1]})
开发者ID:madjoint,项目名称:MM-SMS,代码行数:3,代码来源:tests.py


示例18: test_071_register2

	def test_071_register2(self):
		self.assertEqual(web.start('s', test_user2), "Thank you for subscribing to mmatcher.com.\nFor instructions on how to use mmatcher reply 'H' to this message.")
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py


示例19: test_096_list_interests2

	def test_096_list_interests2(self):
		self.assertEqual(set(web.start('i', test_user2).split('\n')),
						{'I{}:selling unittestingtestcases for {}(1)'.format(x,y) for x,y in [(9,9),(7,7),(5,5),(3,3),(2,10),(1,1)]})
开发者ID:madjoint,项目名称:MM-SMS,代码行数:3,代码来源:tests.py


示例20: test_073_add_interest

	def test_073_add_interest(self):
		self.assertEqual(web.start('a10 selling unittestingtestcases for 1', test_user2), 'Your interest I1 is added with 10 days validity. It currently has 1 match. More matches will arrive on SMS later.')
开发者ID:madjoint,项目名称:MM-SMS,代码行数:2,代码来源:tests.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python mmvt_utils.get_user_fol函数代码示例发布时间:2022-05-27
下一篇:
Python web.parse函数代码示例发布时间: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