from src.interfacing.ogs.connect import Authentication import codecs import sys import os from time import sleep def loadList(pNameFile): iList = [] with codecs.open(pNameFile, "r", "utf-8") as f: for line in f: iList.append(line) return iList if __name__ == "__main__": a = Authentication("Kuksu League", "", testing=False); iGroupNames = loadList("E:/Project/OGS/OGS-League/group_names.txt"); iGroupIDs = loadList("E:/Project/OGS/OGS-League/group_ids.txt"); iGroupPlayersRaw = loadList("E:/Project/OGS/OGS-League/group_players.txt") nPlayers = len(iGroupPlayersRaw); iGroupPlayers = []; for i in range(nPlayers): iGroupPlayers.append(list(iGroupPlayersRaw[i].split('\t'))); iGroupPlayers[i][1] = (int)(iGroupPlayers[i][1]); nGroups = len(iGroupNames); for i in range(nGroups):
from src.interfacing.ogs.connect import Authentication import codecs import sys import os from time import sleep def loadList(pNameFile): iList = [] with codecs.open(pNameFile, "r", "utf-8") as f: for line in f: iList.append(line) return iList if __name__ == "__main__": a = Authentication("Kuksu League", "", testing=False); iGroupNames = loadList("E:/Project/OGS/OGS-League/group_names.txt"); iGroupIDs = loadList("E:/Project/OGS/OGS-League/group_ids.txt"); 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]); iDescription = """ Kuksu Main Title Tournament 9th Cycle Group %s
from src.interfacing.ogs.connect import Authentication import codecs import sys import os from time import sleep def loadList(pNameFile): iList = [] with codecs.open(pNameFile, "r", "utf-8") as f: for line in f: iList.append(line) return iList if __name__ == "__main__": a = Authentication("Kuksu League", "", testing=False); iGroupNames = loadList("E:/Project/OGS/OGS-League/group_names.txt"); fGroupIDs = codecs.open("E:/Project/OGS/OGS-League/group_ids.txt", "w", "utf-8"); nGroups = len(iGroupNames); for i in range(nGroups): 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
FOO.text("",""" We've also imported the variable 'resources' (from src/interfacing/ogs/resources.py). This is the dictionary that contains all recognizable paths. Moreover, you can try 'guessing' a path, and even if it is not registered and it will try to accomodate as \ best it can.\ ""","""\ Now we just need to create an Authentication object, and we are good to go: >> id_card = Authentication({username},'***') # <- Your password goes here From now on, we'll be connecting to the OGS Server, and send requests from your account. \ These requests WILL have an effect on the server, so, thread with care.""".format(username = repr(username))) FOO.change_flow(True) while FOO.flow_control_is(True): try: id_card = Authentication(username, my_password) FOO.text(""" Success!!! You've been authenticated. That means you've been given an access token, and a refresh token, \ and you need to specify the Bearer and ...""", """ -- NOPE! I have my id_card! -- """, """You're damn right! It'll do all that stuff for ya. """,""" You could also try on the Beta Server by calling: >> id_card = Authentication({username},'***', testing = True) # <- Your password goes here but bear in mind you would need to create an account there, and require a different set of keys. We will not be doing that today, because we are too cool for the Beta Server.