Skip to content

Commit

Permalink
Merge branch 'main' into main_Martin
Browse files Browse the repository at this point in the history
  • Loading branch information
Martintkcs committed Jul 13, 2023
2 parents 9012f06 + 67dc24f commit 8a10fd2
Show file tree
Hide file tree
Showing 327 changed files with 57,667 additions and 739 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,11 @@ analogic.egg-info
analogic_pool.egg-info
analogic_file_upload.egg-info
config.js
cam.ini
camsecure.ini
loginbasic.ini
logincam.ini
analogic/tests/apps/cam/app.json
analogic/tests/apps/camsecure/app.json
analogic/tests/apps/default/app.json
analogic/tests/apps/logincam/app.json
1 change: 1 addition & 0 deletions analogic/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@
from .exceptions import AnalogicException
from .exceptions import AnalogicProxyException
from .exceptions import AnalogicTM1ServiceException
from .exceptions import AnalogicAccessDeniedException
10 changes: 5 additions & 5 deletions analogic/analogic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
from analogic.authentication_provider import AuthenticationProvider
from analogic.condition import Condition
import inspect
from flask_caching import Cache
from analogic.setting import SettingManager
from datetime import timedelta
import importlib
from analogic.version import version
from analogic.task import scheduler
import atexit

Expand Down Expand Up @@ -80,7 +78,7 @@ def register_application(self, application_dir, blueprint: "Blueprint", **option

super().register_blueprint(blueprint, **options)
except Exception as e:
logging.getLogger(__name__).error('Error registering application' + blueprint.name + ': ' + str(e))
logging.getLogger(__name__).error('Error registering application ' + blueprint.name + ': ' + str(e))

def create_authentication_provider(self, analogic_application, analogic_application_path):
with self.app_context():
Expand Down Expand Up @@ -146,7 +144,7 @@ def evaluate_condition(self, config):
if module_name in sys.modules:
module = sys.modules[module_name]
else:
module = importlib.import_module(module_name) # Todo ModuleNotFoundError
module = importlib.import_module(module_name)

condition_class = getattr(module, class_name)
condition = condition_class()
Expand Down Expand Up @@ -279,7 +277,7 @@ def _load_modules(app, modules_dir, check_prefix, register_func):

module_dir = os.path.join(modules_dir, module_dir_name)

if os.path.isdir(module_dir) and module_dir_name != '.git' and (
if os.path.isdir(module_dir) and module_dir_name != '.git' and module_dir_name != 'tests' and (
check_prefix is False or (
module_dir_name.startswith(ALLOWED_EXTENSION_PREFIX) and not module_dir_name.endswith('dist-info'))):

Expand Down Expand Up @@ -308,6 +306,8 @@ def _register_application(app, application_dir, application_name, files):

def _fast_scan_dir(directory, ext):
sub_folders, files = [], {}
if '.git' in directory or 'tests' in directory:
return sub_folders, files

for f in os.scandir(directory):
if f.is_dir():
Expand Down
Loading

0 comments on commit 8a10fd2

Please sign in to comment.