def responseDictFromInputDict(self, dataDict):
		responseDict = {}
		responseDict['TO_USER'] = dataDict['FromUserName']
		responseDict['FROM_USER'] = dataDict['ToUserName']
		responseDict['TIME_STEMP'] = str(timeHelper.unixTimeStamp())
		text = u'你好,系统尚在测试中……您刚才说的是:' + dataDict['Content']
		responseDict['RESPONSE_CONTENT'] = text.encode('UTF-8')
		return responseDict
 def responseDict(self):
     responseDict = {}
     try:
         responseDict['RESPONSE_CONTENT'] = self.worker.response.encode('UTF-8')
         responseDict['TO_USER'] = self.dict['FromUserName']
         responseDict['FROM_USER'] = self.dict['ToUserName']
         responseDict['TIME_STEMP'] = str(timeHelper.unixTimeStamp())
     except:
         pass
     return responseDict
Exemplo n.º 3
0
 def responseDict(self):
     responseDict = {}
     try:
         #responseDict['RESPONSE_CONTENT'] = self.worker.response.encode('UTF-8')
         responseDict['RESPONSE_CONTENT'] = self.dict['Content']
         responseDict['TO_USER'] = self.dict['FromUserName']
         responseDict['FROM_USER'] = self.dict['ToUserName']
         responseDict['TIME_STEMP'] = str(timeHelper.unixTimeStamp())
     except:
         pass
     return responseDict
 def jilu(self, content):
     timestamp = timeHelper.unixTimeStamp()
     self.c.execute('''INSERT INTO yulu (timestamp, content) VALUES({},'{}')'''.format(timestamp,content))
     self.conn.commit()
Exemplo n.º 5
0
 def jilu(self, content):
     timestamp = timeHelper.unixTimeStamp()
     self.c.execute(
         '''INSERT INTO yulu (timestamp, content) VALUES({},'{}')'''.format(
             timestamp, content))
     self.conn.commit()