コード例 #1
0
class TFLPlugin(WillPlugin):
    def __init__(self, *args, **kwargs):
        self.tfl_tube = TFLTube()
        self.tfl_road = TFLRoad()
        return WillPlugin.__init__(self, *args, **kwargs)

    @respond_to("^tfl tube me (?P<line>.*)$")
    def tfl_tube_me(self, message, line):
        """
        tfl tube me ___: Get the status of the given tube line
        """
        line_status = self.tfl_tube.get_line_status(line)
        self.reply(message, line_status)

    @respond_to("^tfl road me (?P<road>.*)$")
    def tfl_road_me(self, message, road):
        """
        tfl road me ___: Get the status of the given road
        """
        road_status = self.tfl_road.get_road_status(road)
        self.reply(message, road_status)
コード例 #2
0
ファイル: tfl.py プロジェクト: Staberinde/my-will
class TFLPlugin(WillPlugin):

    def __init__(self, *args, **kwargs):
        self.tfl_tube = TFLTube()
        self.tfl_road = TFLRoad()
        return WillPlugin.__init__(self, *args, **kwargs)

    @respond_to("^tfl tube me (?P<line>.*)$")
    def tfl_tube_me(self, message, line):
        """
        tfl tube me ___: Get the status of the given tube line
        """
        line_status = self.tfl_tube.get_line_status(line)
        self.reply(message, line_status)

    @respond_to("^tfl road me (?P<road>.*)$")
    def tfl_road_me(self, message, road):
        """
        tfl road me ___: Get the status of the given road
        """
        road_status = self.tfl_road.get_road_status(road)
        self.reply(message, road_status)
コード例 #3
0
ファイル: tfl.py プロジェクト: Staberinde/my-will
 def __init__(self, *args, **kwargs):
     self.tfl_tube = TFLTube()
     self.tfl_road = TFLRoad()
     return WillPlugin.__init__(self, *args, **kwargs)
コード例 #4
0
 def __init__(self, *args, **kwargs):
     self.tfl_tube = TFLTube()
     self.tfl_road = TFLRoad()
     return WillPlugin.__init__(self, *args, **kwargs)