Проверка на root только для Linux (в винде не надо) + Fixes #4

This commit is contained in:
Jack Stdin
2016-02-14 16:15:10 +03:00
parent cb1da8dd5f
commit 61435791fc
5 changed files with 25 additions and 8 deletions

View File

@@ -15,6 +15,10 @@ class AoDataParser:
else:
self.allowed_fields = db_shemas[self.datasource.table_name].fields
# Создаем временную папку, если ее нет
if not os.path.exists(folders.temp):
os.makedirs(folders.temp)
self.pagesize = pagesize
self.currentpage = 0
self.counter = 0

View File

@@ -21,8 +21,9 @@ class AoRar:
try:
local_filename = os.path.abspath(folders.temp + "/" + url.split('/')[-1])
if os.path.isfile(local_filename):
# TODO: UNCOMMENT os.remove(local_filename)
return local_filename
os.remove(local_filename)
else:
os.makedirs(local_filename)
request = requests.get(url, stream=True)
with open(local_filename, 'wb') as f: