iGroupNames[i] = iGroupNames[i].replace("\r\n", "") iGroupNames[i] = iGroupNames[i].replace("\n", "") iTournament = a.post(['tournaments'],{ "name":"Kuksu Main Title Tournament 9th Cycle - Group %s" % iGroupNames[i], "group":515, "tournament_type":"roundrobin", "description":"Kuksu Main Title Tournament 9th Cycle - Group %s" % iGroupNames[i], "board_size":19, "handicap":0, #default -1 for auto "time_start": "2015-12-01T00:00:00Z", "time_control_parameters":{ "time_control":"fischer", "initial_time":604800, "max_time":604800, "time_increment":86400 }, "rules": "korean", "exclusivity": "invite", # open, group. default "exclude_provisional": False, # default "auto_start_on_max": True, # default "analysis_enabled": True, #default "settings":{ "maximum_players":10, }, "players_start": 10, #default "first_pairing_method": "slide", #slaughter, random, slide, strength . default "subsequent_pairing_method": "slide", # default "min_ranking":0, "max_ranking":36 }); print("Tournament %s with id %d created.\n" % (iGroupNames[i], iTournament["id"]));
iGroupPlayers[i][1] = (int)(iGroupPlayers[i][1]); nGroups = len(iGroupNames); for i in range(nGroups): iGroupNames[i] = iGroupNames[i].replace("\r\n", ""); iGroupNames[i] = iGroupNames[i].replace("\n", ""); iGroupIDs[i] = iGroupIDs[i].replace("\r\n", ""); iGroupIDs[i] = iGroupIDs[i].replace("\n", ""); iGroupIDs[i] = int(iGroupIDs[i]); for i in range(nPlayers): for j in range(nGroups): if (iGroupNames[j] == iGroupPlayers[i][0]): print("Inviting Player %d to Group %s (%d)\n" % (iGroupPlayers[i][1], iGroupNames[j], iGroupIDs[j])); a.post(['tournaments', iGroupIDs[j], 'players'], app_param = {"player_id":iGroupPlayers[i][1]} ) break; sleep(1); # tourney id 7370 """ iTournament = a.post(['tournaments'],{ "id":12650, "name":"Test Tournament 2", "group":515, "tournament_type":"roundrobin", "description":"<b>Test 3</b>", "board_size":19,
.............>> app_param = {{'recipients':[{username}], ..........................>> 'subject':'Auto message', ..........................>> 'body':"..."}})\ """.format(username = repr(username)), end = "") FOO.ANNOYANCE+=1 elif FOO.ANNOYANCE == 4: FOO.text(""" >> id_card.post(['user', 'mail'], .............>> app_param = {{'recipients':[{username}], ..........................>> 'subject':'Auto message', ..........................>> 'body':"..."}})\ """.format(username = repr(username))) if FOO.ANNOYANCE == 4: id_card.post(['user', 'mail'], app_param = {'recipients': [username], 'subject' : 'Auto message', 'body' : FOO.arrange_automail(username, message)}) FOO.text(""" Done! Please check your OGS mail.""", """ So, I hope this helped explain a bit how the whole system works. \ I'll have more examples for you in the future.""", end = "") except HTTPError as e: FOO.text(""" Hmmmmm, your request was met with an error: ERROR {error.code}: {error.reason} This is odd because it normally works. I'll refresh your credentials.""".format(error = e))