Commit 1e5e5f07 authored by Nitha Sagar Jayanna's avatar Nitha Sagar Jayanna
Browse files

minor update

parent cbe5b38b
...@@ -126,7 +126,7 @@ def urlDownload(start,end): ...@@ -126,7 +126,7 @@ def urlDownload(start,end):
filelist = accessurl.urlaccess([url]) filelist = accessurl.urlaccess([url])
#print(filelist) #print(filelist)
if len(filelist) == 0: if len(filelist) == 0:
print("Download Error: No data available",url) print("No data available",url)
newfilelist=[] newfilelist=[]
for i in range (span.days + 1): for i in range (span.days + 1):
...@@ -147,8 +147,8 @@ def urlDownload(start,end): ...@@ -147,8 +147,8 @@ def urlDownload(start,end):
#print(downloadURL) #print(downloadURL)
fileLoc = dirCreate.create(router,startYear,startMonth) fileLoc = dirCreate.create(router,startYear,startMonth)
#print(fileLoc) #print(fileLoc)
print("downloading") #print("downloading")
#urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0]) urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0])
logString = i[0]+" "+i[1]+"\n" logString = i[0]+" "+i[1]+"\n"
logHandle = open(log_file,'a+') logHandle = open(log_file,'a+')
logHandle.write(logString) logHandle.write(logString)
...@@ -175,7 +175,7 @@ def urlDownload(start,end): ...@@ -175,7 +175,7 @@ def urlDownload(start,end):
filelist = accessurl.urlaccess([url]) filelist = accessurl.urlaccess([url])
#print(filelist) #print(filelist)
if len(filelist) == 0: if len(filelist) == 0:
print("No data availbale",) print("No data available",url)
for i in filelist: for i in filelist:
downloadRequired = filecheck(i) downloadRequired = filecheck(i)
...@@ -185,8 +185,8 @@ def urlDownload(start,end): ...@@ -185,8 +185,8 @@ def urlDownload(start,end):
#print(downloadURL) #print(downloadURL)
fileLoc = dirCreate.create(router,startYear,startMonth) fileLoc = dirCreate.create(router,startYear,startMonth)
#print(fileLoc) #print(fileLoc)
print("downloading") #print("downloading")
#urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0]) urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0])
logString = i[0]+" "+i[1]+"\n" logString = i[0]+" "+i[1]+"\n"
logHandle = open(log_file,'a+') logHandle = open(log_file,'a+')
logHandle.write(logString) logHandle.write(logString)
...@@ -212,7 +212,7 @@ def urlDownload(start,end): ...@@ -212,7 +212,7 @@ def urlDownload(start,end):
filelist = accessurl.urlaccess([url]) filelist = accessurl.urlaccess([url])
#print(filelist) #print(filelist)
if len(filelist) == 0: if len(filelist) == 0:
print("Download Error: No data available",url) print("No data available",url)
newfilelist=[] newfilelist=[]
for i in range (span.days + 1): for i in range (span.days + 1):
...@@ -233,8 +233,8 @@ def urlDownload(start,end): ...@@ -233,8 +233,8 @@ def urlDownload(start,end):
#print(downloadURL) #print(downloadURL)
fileLoc = dirCreate.create(router,startYear,startMonth) fileLoc = dirCreate.create(router,startYear,startMonth)
#print(fileLoc) #print(fileLoc)
print("downloading") #print("downloading")
#urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0]) urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0])
logString = i[0]+" "+i[1]+"\n" logString = i[0]+" "+i[1]+"\n"
logHandle = open(log_file,'a+') logHandle = open(log_file,'a+')
logHandle.write(logString) logHandle.write(logString)
...@@ -248,7 +248,7 @@ def urlDownload(start,end): ...@@ -248,7 +248,7 @@ def urlDownload(start,end):
filelist = accessurl.urlaccess([url]) filelist = accessurl.urlaccess([url])
#print(filelist) #print(filelist)
if len(filelist) == 0: if len(filelist) == 0:
print("Error: No data Available") print("No data available",url)
newfilelist=[] newfilelist=[]
for i in range (span.days + 1): for i in range (span.days + 1):
day = startDate + timedelta(days=i) day = startDate + timedelta(days=i)
...@@ -266,8 +266,8 @@ def urlDownload(start,end): ...@@ -266,8 +266,8 @@ def urlDownload(start,end):
#print(downloadURL) #print(downloadURL)
fileLoc = dirCreate.create(router,startYear,startMonth) fileLoc = dirCreate.create(router,startYear,startMonth)
#print(fileLoc) #print(fileLoc)
print("downloading") #print("downloading")
#urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0]) urllib.request.urlretrieve(downloadURL, fileLoc+"/"+i[0])
logString = i[0]+" "+i[1]+"\n" logString = i[0]+" "+i[1]+"\n"
logHandle = open(log_file,'a+') logHandle = open(log_file,'a+')
logHandle.write(logString) logHandle.write(logString)
...@@ -311,3 +311,5 @@ else: ...@@ -311,3 +311,5 @@ else:
urlDownload(startdate[0],enddate) urlDownload(startdate[0],enddate)
remove_empty_lines() remove_empty_lines()
print("Download Complete,exiting....")
print("Error: No data Available")
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment