Skip to content

Commit

Permalink
resolve pylint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
michmuel committed Dec 4, 2024
1 parent 5e5e1b0 commit 0081889
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions geolink_formatter/entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
""" Provides the Msg, Document and File classes. """
import datetime


Expand Down
1 change: 1 addition & 0 deletions geolink_formatter/format.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
""" Provides class HTML for rendering the xml document from the geolink api as html. """
from datetime import date


Expand Down
7 changes: 4 additions & 3 deletions geolink_formatter/parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
""" Provides classes for parsing the xml document from the geolink api. """
from importlib import resources as impresources
import datetime
import requests
import importlib
from lxml.etree import DTD, DocumentInvalid, fromstring
from xmlschema import XMLSchema11
from geolink_formatter.entity import Document, File
Expand Down Expand Up @@ -61,7 +62,7 @@ def __init__(self, host_url=None, version='1.2.5', dtd_validation=False, xsd_val
self._version = version
self._dtd_validation = dtd_validation
self._xsd_validation = xsd_validation
xsd = importlib.resources.files('geolink_formatter') / 'schema' / f'v{version}.xsd'
xsd = impresources.files('geolink_formatter') / 'schema' / f'v{version}.xsd'
if self._xsd_validation:
with xsd.open(mode='r', encoding='utf-8') as xsd_f:
self._schema = XMLSchema11(xsd_f.read())
Expand Down Expand Up @@ -121,7 +122,7 @@ def _process_single_document(self, document_el, language_link):
files = []
for file_el in document_el.iter('file'):
href = file_el.attrib.get('href')
if self.host_url and not href.startswith(u'http://') and not href.startswith('https://'):
if self.host_url and not href.startswith('http://') and not href.startswith('https://'):
href = f'{self.host_url}{href}'
files.append(File(
title=file_el.attrib.get('title'),
Expand Down
4 changes: 3 additions & 1 deletion geolink_formatter/utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
""" Provides additional methods usable for parsing the xml document from the geolink api. """


def filter_duplicated_documents(documents):
"""
Expand All @@ -10,7 +12,7 @@ def filter_duplicated_documents(documents):
Returns:
list[geolink_formatter.entity.Document]: filtered list of documents
"""
documents_filtered = list()
documents_filtered = []
for document in documents:
if (
[document.id, document.language_link]
Expand Down

0 comments on commit 0081889

Please sign in to comment.