Feature: подгрузка переменных при функции фаблонов ini()

master 3.7.3.4
root 1 year ago
parent 3ac6c7fe3e
commit 9ac6eb9b1c

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
import datetime
# Copyright 2008-2016 Mir Calculate. http://www.calculate-linux.org
#
# Licensed under the Apache License, Version 2.0 (the "License");
@ -163,6 +163,8 @@ class LayeredIni():
profile_path = self.get_profile_path(dv)
if profile_path:
repos = RepositorySubstituting(dv, self._baseDir)
a = list(searchProfile(
profile_path, self.IniPath.IniName, repository_sub=repos))
return list(searchProfile(
profile_path, self.IniPath.IniName, repository_sub=repos))
return []
@ -3158,12 +3160,11 @@ class templateFunction(_error, _warning, _shareTemplate, _shareTermsFunction,
# Получаем время модификации конфигурационного файла
curTime = self.getTimeFile(self.fileConfigIni)
if 1 <= len(terms) <= 3:
if self.timeIni != curTime:
# читаем переменные из файла
self.prevDictIni = self.loadVarsIni(self.fileConfigIni)
self.currDictIni = {}
self.currDictIni.update(self.prevDictIni)
self.timeIni = self.getTimeFile(self.fileConfigIni)
# читаем переменные из файла
self.prevDictIni = self.loadVarsIni(self.fileConfigIni)
self.currDictIni = {}
self.currDictIni.update(self.prevDictIni)
self.timeIni = self.getTimeFile(self.fileConfigIni)
section, op, varname = nameLocVar.partition(".")
value = self.upperIni.get(section, varname, raw=True, fallback=None)
if value is None:

Loading…
Cancel
Save