コード例 #1
0
ファイル: client.py プロジェクト: lpredova/pybookie
 def _process(self):
     self.msg = self._receive(True)
     if self.msg:
         request = json.loads(self.msg.content)
         if request['request_type'] == 'games':
             self.games = request['data']
             self.show_dialog()
         if request['request_type'] == 'game_evaluation':
             PrintFormatter.results(request['data'])
             Evaluator.make_bet(self.mood, request['data'])
             print "\n********Results********\n"
             Evaluator.find_result(request['data'])
             self.show_dialog()
コード例 #2
0
ファイル: client.py プロジェクト: lpredova/pybookie
 def _process(self):
     self.msg = self._receive(True)
     if self.msg:
         request = json.loads(self.msg.content)
         if request['request_type'] == 'games':
             self.games = request['data']
             self.show_dialog()
         if request['request_type'] == 'game_evaluation':
             PrintFormatter.results(request['data'])
             Evaluator.make_bet(self.mood, request['data'])
             print "\n********Results********\n"
             Evaluator.find_result(request['data'])
             self.show_dialog()
コード例 #3
0
ファイル: client.py プロジェクト: lpredova/pybookie
        def set_free_bet_preferences(self):
            if self.games:
                PrintFormatter.games(self.games)

            teams = []
            number_of_teams = input("\nNumber of games:")

            for i in range(0, int(number_of_teams)):
                print "GAME %d. \n" % (i + 1)
                team_a = raw_input("\nTeam A id: ")
                team_b = raw_input("\nTeam B id: ")

                teams.append({'teamA': team_a, 'teamB': team_b})

            result = json.dumps({'request_type': 'team_selection', 'teams': teams})
            self.send_message(result)
コード例 #4
0
ファイル: client.py プロジェクト: lpredova/pybookie
        def set_free_bet_preferences(self):
            if self.games:
                PrintFormatter.games(self.games)

            teams = []
            number_of_teams = input("\nNumber of games:")

            for i in range(0, int(number_of_teams)):
                print "GAME %d. \n" % (i + 1)
                team_a = raw_input("\nTeam A id: ")
                team_b = raw_input("\nTeam B id: ")

                teams.append({'teamA': team_a, 'teamB': team_b})

            result = json.dumps({
                'request_type': 'team_selection',
                'teams': teams
            })
            self.send_message(result)