Merge pull request #55 from expsa/fix_web_map

try it
This commit is contained in:
mohammed-alkhazrji 2025-12-07 13:24:28 +03:00 committed by GitHub
commit e973a538d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 2 deletions

View File

@ -13,13 +13,12 @@ _logger = logging.getLogger(__name__)
_map_view_validator = None
@view_validation.validate('map')
def schema_map_view(arch, **kwargs):
global _map_view_validator
if _map_view_validator is None:
with misc.file_open(os.path.join('odex30_web_map', 'views', 'odex30_web_map.rng')) as f:
with misc.file_open('odex30_web_map/views/odex30_web_map.rng') as f:
_map_view_validator = etree.RelaxNG(etree.parse(f))
if _map_view_validator.validate(arch):
@ -28,3 +27,18 @@ def schema_map_view(arch, **kwargs):
for error in _map_view_validator.error_log:
_logger.error(ustr(error))
return False
# @view_validation.validate('map')
# def schema_map_view(arch, **kwargs):
# global _map_view_validator
#
# if _map_view_validator is None:
# with misc.file_open(os.path.join('odex30_web_map', 'views', 'odex30_web_map.rng')) as f:
# _map_view_validator = etree.RelaxNG(etree.parse(f))
#
# if _map_view_validator.validate(arch):
# return True
#
# for error in _map_view_validator.error_log:
# _logger.error(ustr(error))
# return False