|
|
|
@ -516,8 +516,11 @@ class VariableLoader:
|
|
|
|
|
self.logger = datavars.logger
|
|
|
|
|
self.ini_filler = NamespaceIniFiller()
|
|
|
|
|
|
|
|
|
|
self.variables_path = os.path.normpath(variables_path)
|
|
|
|
|
self.variables_package = '.'.join(self.variables_path.split("/"))
|
|
|
|
|
self.variables_path = os.path.join(
|
|
|
|
|
__file__[:-len("calculate/variables/loader.py")],
|
|
|
|
|
variables_path)
|
|
|
|
|
self.variables_package = '.'.join(os.path.normpath(
|
|
|
|
|
variables_path).split("/"))
|
|
|
|
|
self.repository_map = repository_map
|
|
|
|
|
|
|
|
|
|
def load_variables_package(self, package_name: str) -> None:
|
|
|
|
@ -773,11 +776,14 @@ class Datavars:
|
|
|
|
|
def _get_available_packages(self) -> dict:
|
|
|
|
|
'''Метод для получения словаря с имеющимися пакетами переменных
|
|
|
|
|
и путями к ним.'''
|
|
|
|
|
variables_path = os.path.join(
|
|
|
|
|
__file__[:-len("calculate/variables/loader.py")],
|
|
|
|
|
self._variables_path)
|
|
|
|
|
available_packages = dict()
|
|
|
|
|
for file_name in os.listdir(self._variables_path):
|
|
|
|
|
for file_name in os.listdir(variables_path):
|
|
|
|
|
if file_name.startswith('__'):
|
|
|
|
|
continue
|
|
|
|
|
file_path = os.path.join(self._variables_path, file_name)
|
|
|
|
|
file_path = os.path.join(variables_path, file_name)
|
|
|
|
|
if os.path.isdir(file_path):
|
|
|
|
|
available_packages.update({file_name: file_path})
|
|
|
|
|
return available_packages
|
|
|
|
|