Exemplo n.º 1
0
 def weather(self, msg):
     match = re.match(ur'^(weather|天气) (\w+|[\u4e00-\u9fa5]+)', msg.content)
     if match:
         # logging.info(u"查询天气...")
         command = match.group(1)
         city = match.group(2)
         # logging.info(msg.content)
         if command == 'weather' or command == u'天气':
             query = Weather()
             info = query.getWeatherOfCity(city)
             self.reply(str(info))
             return True
     return False
Exemplo n.º 2
0
 def weather(self, msg):
     match = re.match(ur'^(weather|天气) (\w+|[\u4e00-\u9fa5]+)', msg.content)
     if match:
         logging.info("RUNTIMELOG 查询天气...")
         command = match.group(1)
         city = match.group(2)
         logging.info("RUNTIMELOG 查询天气语句: " + msg.content)
         if command == 'weather' or command == u'天气':
             query = Weather()
             info = query.getWeatherOfCity(city)
             logging.info("RESPONSE " + str(info))
             self.reply(str(info))
             return True
     return False
Exemplo n.º 3
0
 def wether(self, msg):
     match = re.match(ur'^(weather|天气) (\w+|[\u4e00-\u9fa5]+)',msg.content)
     if match:
         logging.info("查询天气...")
         print msg.content
         command = match.group(1)
         city = match.group(2)
         logging.info(msg.content)
         print city
         if command == 'weather' or command == u'天气':
             # self.reply("我开始查询" + city + "的天气啦")
             query = Weather()
             info = query.getWeatherOfCity(city)
             logging.info(str(info))
             self.reply(str(info))
             return True
     return False
Exemplo n.º 4
0
 def weather(self, msg):
     match = re.match(ur'^(weather|天气) (\w+|[\u4e00-\u9fa5]+)', msg.content)
     if match:
         logging.info("查询天气...")
         print msg.content
         command = match.group(1)
         city = match.group(2)
         logging.info(msg.content)
         print city
         if command == 'weather' or command == u'天气':
             # self.reply("我开始查询" + city + "的天气啦")
             query = Weather()
             info = query.getWeatherOfCity(city)
             logging.info(str(info))
             self.reply(str(info))
             return True
     return False