diff --git a/main.py b/main.py index 5951697..b9c6e11 100644 --- a/main.py +++ b/main.py @@ -36,7 +36,7 @@ class Receive(Base): Distance = Column(Integer) Azimuth = Column(Integer) Band = Column(Integer) - Version = Column(Float) + Version = Column(String) Code = Column(Integer) @@ -79,13 +79,17 @@ links = soup.find_all("a") for link in links: linkArray.append(link.get('href')) ReportDownload = linkArray[-6:-5] +print(ReportDownload[0]) #Download the latest zip and save it to the working folder. download = requests.get(ReportDownload[0], stream=True) -with open('./download.zip', 'wb') as fd: - for chunk in download.iter_content(chunk_size=128): - fd.write(chunk) -# print(ReportDownload[0]) +try: + with open('./download.zip', 'wb') as fd: + for chunk in download.iter_content(chunk_size=128): + fd.write(chunk) +except: + pass +print(ReportDownload[0]) #unzip the file and grab the CSV filename with zipfile.ZipFile('./download.zip', 'r') as zip: diff --git a/run.bat b/run.bat deleted file mode 100644 index 3dcbc5e..0000000 --- a/run.bat +++ /dev/null @@ -1,2 +0,0 @@ -@echo off -cmd /k "cd /d C:\Users\ICYN3\Documents\dev\wspr\venv\Scripts & activate & cd /d C:\Users\ICYN3\Documents\dev\wspr & python main.py & exit" diff --git a/wsprRun.bat b/wsprRun.bat new file mode 100644 index 0000000..638dffa --- /dev/null +++ b/wsprRun.bat @@ -0,0 +1,2 @@ +@echo off +cmd /k "cd /d C:\Users\ICYN3\Documents\wsprLogging\venv\Scripts & activate & cd /d C:\Users\ICYN3\Documents\wsprLogging & python main.py & exit"