diff --git a/qgis-app/layerdefinitions/file_handler.py b/qgis-app/layerdefinitions/file_handler.py index f6606948..53529325 100644 --- a/qgis-app/layerdefinitions/file_handler.py +++ b/qgis-app/layerdefinitions/file_handler.py @@ -42,6 +42,7 @@ def get_url_datasource(xmlfile): result = url[0] if url else None return result + def get_provider(xmlfile): tree = parse_qlr(xmlfile) root = tree.getroot() diff --git a/qgis-app/layerdefinitions/models.py b/qgis-app/layerdefinitions/models.py index 131450ee..015674d6 100644 --- a/qgis-app/layerdefinitions/models.py +++ b/qgis-app/layerdefinitions/models.py @@ -18,7 +18,8 @@ class LayerDefinition(Resource): # file file = models.FileField( _('Layer Definition file'), - help_text=_('A Layer Definition file. The filesize must less than 1MB'), + help_text=_('A Layer Definition file. ' + 'The filesize must less than 1MB'), upload_to=LAYERDEFINITIONS_STORAGE_PATH, validators=[FileExtensionValidator(allowed_extensions=['qlr'])], null=False) diff --git a/qgis-app/layerdefinitions/tests/test_file_handler.py b/qgis-app/layerdefinitions/tests/test_file_handler.py index e4143344..b51834ff 100644 --- a/qgis-app/layerdefinitions/tests/test_file_handler.py +++ b/qgis-app/layerdefinitions/tests/test_file_handler.py @@ -19,6 +19,7 @@ def setUp(self): self.qlr_file = os.path.join( TESTFILE_DIR, "my-vapour-pressure.qlr") + class TestParseQlr(SetUpTest, TestCase): """Test the parse_qlr function.""" diff --git a/qgis-app/layerdefinitions/urls.py b/qgis-app/layerdefinitions/urls.py index b8f59ff6..7204ee15 100644 --- a/qgis-app/layerdefinitions/urls.py +++ b/qgis-app/layerdefinitions/urls.py @@ -15,7 +15,8 @@ urlpatterns = [ # GeoPackage path('', LayerDefinitionListView.as_view(), name='layerdefinition_list'), - path('add/', LayerDefinitionCreateView.as_view(), name='layerdefinition_create'), + path('add/', LayerDefinitionCreateView.as_view(), + name='layerdefinition_create'), path('/', LayerDefinitionDetailView.as_view(), name='layerdefinition_detail'), path('/update/', LayerDefinitionUpdateView.as_view(), @@ -33,5 +34,6 @@ name='layerdefinition_require_action'), # JSON - path('sidebarnav/', layerdefinition_nav_content, name="layerdefinition_nav_content"), + path('sidebarnav/', layerdefinition_nav_content, + name="layerdefinition_nav_content"), ]