Fixed linter warnings. Updated dependencies versions. Updated software version.

dev
Franco Masotti 2 years ago
parent 6e1a308d17
commit 268b4bcc7c
Signed by: frnmst
GPG Key ID: 24116ED85666780A
  1. 4
      Pipfile
  2. 4
      docs/conf.py
  3. 3
      fattura_elettronica_reader/api.py
  4. 27
      fattura_elettronica_reader/cli.py
  5. 5
      setup.py

@ -7,7 +7,7 @@ verify_ssl = true
[packages]
requests = "==2.24.0"
lxml = "==4.5.1"
lxml = "==4.5.2"
flake8 = "==3.8.3"
flake8-docstrings = "==1.5.0"
yapf = "==0.30.0"
@ -16,7 +16,7 @@ twine = "==3.2.0"
atomicwrites = "==1.4.0"
filetype = "==1.0.7"
appdirs = "==1.4.4"
Sphinx = "==3.1.1"
Sphinx = "==3.1.2"
[requires]
python_version = "3.8"

@ -24,9 +24,9 @@ copyright = '2019-2020, Franco Masotti'
author = 'Franco Masotti'
# The short X.Y version
version = '0.1.0'
version = '1.0.0'
# The full version, including alpha/beta/rc tags
release = '0.1.0'
release = '1.0.0'
# -- General configuration ---------------------------------------------------

@ -861,7 +861,8 @@ def pipeline(source: str, file_type: str, data: dict):
invoice_xslt_file).is_file():
get_remote_file(
invoice_xslt_file,
config['invoice file']['XSLT ' + invoice_xslt_type +
config['invoice file']['XSLT ' +
data['invoice xslt type'] +
' download'])
invoice_xslt_root = parse_xml_file(invoice_xslt_file)
html_output = file_to_consider + '.html'

@ -119,13 +119,13 @@ class CliToApi():
class CliInterface():
"""The interface exposed to the final user."""
r"""The interface exposed to the final user."""
def __init__(self):
"""Set the parser variable that will be used instead of using create_parser."""
r"""Set the parser variable that will be used instead of using create_parser."""
self.parser = self.create_parser()
def create_parser(self):
"""Create the CLI parser."""
r"""Create the CLI parser."""
parser = argparse.ArgumentParser(
description=PROGRAM_DESCRIPTION,
formatter_class=argparse.RawDescriptionHelpFormatter,
@ -143,13 +143,13 @@ class CliInterface():
generic_parser = source_subparsers.add_parser('generic',
help='generic file')
invoice_xslt_type_help = 'select the XML stylesheet file for the invoice. Defaults to "ordinaria". This option is ignored if "-H" is not set'
invoice_parser.add_argument(
'-X',
'--invoice-xslt-type',
choices=['ordinaria', 'PA'],
default='ordinaria',
help=
'select the XML stylesheet file for the invoice. Defaults to "ordinaria". This option is ignored if "-H" is not set'
help=invoice_xslt_type_help,
)
invoice_parser.add_argument(
@ -163,12 +163,12 @@ class CliInterface():
action='store_true',
help='extract embedded attachments')
force_invoice_schema_file_download_help = 'force download of the XML schema necessary for the validation of the invoice file'
invoice_parser.add_argument(
'-E',
'--force-invoice-schema-file-download',
action='store_true',
help=
'force download of the XML schema necessary for the validation of the invoice file'
help=force_invoice_schema_file_download_help,
)
invoice_parser.add_argument('-H',
@ -195,20 +195,20 @@ class CliInterface():
action='store_true',
help='force download of the XML stylesheet file')
ignore_attachment_extension_whitelist_help = 'do not perform file extension checks for the attachments. This option is ignored if "-a" is not set'
invoice_parser.add_argument(
'-w',
'--ignore-attachment-extension-whitelist',
action='store_true',
help=
'do not perform file extension checks for the attachments. This option is ignored if "-a" is not set'
help=ignore_attachment_extension_whitelist_help,
)
ignore_attachment_filetype_whitelist_help = 'do not perform filetype checks for the attachments. This option is ignored if "-a" is not set'
invoice_parser.add_argument(
'-W',
'--ignore-attachment-filetype-whitelist',
action='store_true',
help=
'do not perform filetype checks for the attachments. This option is ignored if "-a" is not set'
help=ignore_attachment_filetype_whitelist_help,
)
###########
@ -220,13 +220,14 @@ class CliInterface():
invoice_p7m_parser = invoice_subparsers.add_parser('p7m', help='p7m')
ignore_signature_check_help = 'avoids checking the cryptographic signature of the invoice file'
invoice_p7m_parser.add_argument(
'-s',
'--ignore-signature-check',
default=False,
action='store_true',
help=
'avoids checking the cryptographic signature of the invoice file')
help=ignore_signature_check_help,
)
invoice_p7m_parser.add_argument(
'-S',

@ -23,7 +23,7 @@ from setuptools import setup, find_packages
setup(
name='fattura_elettronica_reader',
version='0.1.0',
version='1.0.0',
packages=find_packages(exclude=['*tests*']),
license='GPL',
description='A utility that is able to check and extract electronic invoice received from the Sistema di Interscambio.',
@ -50,6 +50,5 @@ setup(
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Programming Language :: Python :: 3',
],
install_requires=['atomicwrites==1.3', 'filetype==1.0', 'appdirs==1.4', 'requests==2.21', 'lxml==4.3'],
install_requires=['atomicwrites>=1.4.0', 'filetype>=1.0.7', 'appdirs>=1.4.4', 'requests>=2.24.0', 'lxml>=4.5.2'],
)

Loading…
Cancel
Save