Beispiel #1
0
 def game_relation(self, s_id, t_id):  #s_id = sourceId t_id = targetId
     response, content = self.request(endpoint="/game/%d/relation/%d/" %
                                      (s_id, t_id))
     if not response.status == 200:
         print "/game/sId/relation/tId GET error"
         self.error_handler(content)
     return GameRelation.from_dict(json.loads(content))
Beispiel #2
0
 def game_relations(self,id):
     print "game relation api_com"
     response, content = self.request(endpoint="/game/%d/relation/"%id)
     if not response.status == 200:
         print "/game/id/relation GET error"
         self.error_handler(content)
     return [GameRelation.from_dict(game_relation) for game_relation in json.loads(content).get("relatedgames")]
Beispiel #3
0
 def game_relations(self, id):
     print "game relation api_com"
     response, content = self.request(endpoint="/game/%d/relation/" % id)
     if not response.status == 200:
         print "/game/id/relation GET error"
         self.error_handler(content)
     return [
         GameRelation.from_dict(game_relation)
         for game_relation in json.loads(content).get("relatedgames")
     ]
Beispiel #4
0
 def game_relation(self,s_id,t_id):     #s_id = sourceId t_id = targetId
     response,content = self.request(endpoint="/game/%d/relation/%d/"%(s_id,t_id))
     if not response.status == 200:
         print "/game/sId/relation/tId GET error"
         self.error_handler(content)
     return GameRelation.from_dict(json.loads(content))