From 8fbcafc6fc2fe274537b297e6eb2473a68150255 Mon Sep 17 00:00:00 2001 From: Rasmus Luha Date: Wed, 16 Mar 2022 03:40:15 +0200 Subject: minor fixes --- getData.py | 4 +++- osSpecific.py | 25 ------------------------- 2 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 osSpecific.py diff --git a/getData.py b/getData.py index dd55cc2..7c64b30 100644 --- a/getData.py +++ b/getData.py @@ -59,12 +59,14 @@ def getTeamsData(url, headers): def getPlayerData(url, headers): + print("Stared reading players data") + # First request is made just to get the amount of pages that must be looped through querystring = {"per_page":"100","page":"0"} response = requests.request("GET", url+"players", headers=headers, params=querystring) pageCount = response.json()["meta"]["total_pages"] - + print("Pages to read: "+str(pageCount)) for el in range(1, pageCount+1): # Requesting pages in loop till pageCount diff --git a/osSpecific.py b/osSpecific.py deleted file mode 100644 index 7caf664..0000000 --- a/osSpecific.py +++ /dev/null @@ -1,25 +0,0 @@ -import os -import sys - -# terminal commands, which are unfortunately os-specific - -def whichOs(): - if sys.platform == "win32": - return "windows" - else: - return "good" # ...right? - -def deleteDataDir(): - if whichOs() == "windows": - os.system("rmdir \s Data") - else: - os.system("rm -r Data") - - -def addDataDir(): - if whichOs() == "windows": - os.system("mkdir Data\Players") - else: - os.system("mkdir -p Data/Players") - print("Created new empty Data directory") - -- cgit v1.2.3