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


Python web.start函数代码示例

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


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


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