Улучшен поиск, правки кода.
This commit is contained in:
@@ -3,6 +3,7 @@ import os
|
||||
|
||||
from aore.config import folders
|
||||
from aore.dbutils.dbschemas import db_shemas
|
||||
from aore.miscutils.exceptions import FiasException
|
||||
from xmlparser import XMLParser
|
||||
|
||||
|
||||
@@ -10,7 +11,7 @@ class AoDataParser:
|
||||
def __init__(self, datasource, pagesize):
|
||||
self.datasource = datasource
|
||||
if self.datasource.table_name not in db_shemas:
|
||||
raise BaseException("Cannot parse {}: Not configured.".format(self.datasource.table_name))
|
||||
raise FiasException("Cannot parse {}: Not configured.".format(self.datasource.table_name))
|
||||
else:
|
||||
self.allowed_fields = db_shemas[self.datasource.table_name].fields
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import rarfile
|
||||
import requests
|
||||
|
||||
from aore.config import folders, unrar_config
|
||||
from aore.miscutils.exceptions import FiasException
|
||||
from aoxmltableentry import AoXmlTableEntry
|
||||
|
||||
|
||||
@@ -29,7 +30,7 @@ class AoRar:
|
||||
if chunk:
|
||||
f.write(chunk)
|
||||
except:
|
||||
raise BaseException("Error downloading. Reason : {}".format(format_exc()))
|
||||
raise FiasException("Error downloading. Reason : {}".format(format_exc()))
|
||||
|
||||
logging.info("Downloaded {} bytes".format(request.headers['Content-length']))
|
||||
return local_filename
|
||||
|
||||
@@ -63,7 +63,7 @@ class Updater:
|
||||
|
||||
def __init_update_entries(self, updates_generator):
|
||||
if self.mode == "http":
|
||||
assert updates_generator
|
||||
assert updates_generator, "No generator"
|
||||
self.tablelist_generator = self.__get_updates_from_rar
|
||||
self.updalist_generator = updates_generator
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user