-
-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
missing-import-error
- Loading branch information
Showing
5 changed files
with
157 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
diff --git a/l10n_it_fatturapa/bindings/_ds.py b/l10n_it_fatturapa/bindings/_ds.py | ||
index a355d135f..fb47a7c83 100644 | ||
--- a/l10n_it_fatturapa/bindings/_ds.py | ||
+++ b/l10n_it_fatturapa/bindings/_ds.py | ||
@@ -5,14 +5,23 @@ | ||
# Namespace http://www.w3.org/2000/09/xmldsig# [xmlns:ds] | ||
|
||
from __future__ import unicode_literals | ||
-import pyxb | ||
-import pyxb.binding | ||
-import pyxb.binding.saxer | ||
+import logging | ||
import io | ||
-import pyxb.utils.utility | ||
-import pyxb.utils.domutils | ||
-import sys | ||
-import pyxb.utils.six as _six | ||
+ | ||
+_logger = logging.getLogger(__name__) | ||
+ | ||
+try: | ||
+ import pyxb | ||
+ import pyxb.binding | ||
+ import pyxb.binding.saxer | ||
+ import pyxb.utils.utility | ||
+ import pyxb.utils.domutils | ||
+ import pyxb.utils.six as _six | ||
+ # Import bindings for namespaces imported into schema | ||
+ import pyxb.binding.datatypes | ||
+except (ImportError) as err: | ||
+ _logger.debug(err) | ||
+ | ||
# Unique identifier for bindings created at the same time | ||
_GenerationUID = pyxb.utils.utility.UniqueIdentifier('urn:uuid:f3386e3c-9e54-11e9-b81a-d43b049899a0') | ||
|
||
@@ -26,9 +35,6 @@ if pyxb.__version__ != _PyXBVersion: | ||
# inside class definitions where property names may conflict. | ||
_module_typeBindings = pyxb.utils.utility.Object() | ||
|
||
-# Import bindings for namespaces imported into schema | ||
-import pyxb.binding.datatypes | ||
- | ||
# NOTE: All namespace declarations are reserved within the binding | ||
Namespace = pyxb.namespace.NamespaceForURI('http://www.w3.org/2000/09/xmldsig#', create_if_missing=True) | ||
Namespace.configureCategories(['typeBinding', 'elementBinding']) | ||
diff --git a/l10n_it_fatturapa/bindings/binding.py b/l10n_it_fatturapa/bindings/binding.py | ||
index 7d1dfe301..05daea982 100644 | ||
--- a/l10n_it_fatturapa/bindings/binding.py | ||
+++ b/l10n_it_fatturapa/bindings/binding.py | ||
@@ -5,14 +5,23 @@ | ||
# Namespace http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2 | ||
|
||
from __future__ import unicode_literals | ||
-import pyxb | ||
-import pyxb.binding | ||
-import pyxb.binding.saxer | ||
+import logging | ||
import io | ||
-import pyxb.utils.utility | ||
-import pyxb.utils.domutils | ||
import sys | ||
-import pyxb.utils.six as _six | ||
+ | ||
+_logger = logging.getLogger(__name__) | ||
+ | ||
+try: | ||
+ import pyxb | ||
+ import pyxb.binding | ||
+ import pyxb.binding.saxer | ||
+ import pyxb.utils.utility | ||
+ import pyxb.utils.domutils | ||
+ import pyxb.utils.six as _six | ||
+ # Import bindings for namespaces imported into schema | ||
+ import pyxb.binding.datatypes | ||
+except (ImportError) as err: | ||
+ _logger.debug(err) | ||
# Unique identifier for bindings created at the same time | ||
_GenerationUID = pyxb.utils.utility.UniqueIdentifier('urn:uuid:f3386e3c-9e54-11e9-b81a-d43b049899a0') | ||
|
||
@@ -26,9 +35,7 @@ if pyxb.__version__ != _PyXBVersion: | ||
# inside class definitions where property names may conflict. | ||
_module_typeBindings = pyxb.utils.utility.Object() | ||
|
||
-# Import bindings for namespaces imported into schema | ||
-import pyxb.binding.datatypes | ||
-import _ds as _ImportedBinding__ds | ||
+from . import _ds as _ImportedBinding__ds | ||
|
||
# NOTE: All namespace declarations are reserved within the binding | ||
Namespace = pyxb.namespace.NamespaceForURI('http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2', create_if_missing=True) | ||
diff --git a/l10n_it_fatturapa/bindings/fatturapa.py b/l10n_it_fatturapa/bindings/fatturapa.py | ||
index 370a93f29..59b9042e8 100644 | ||
--- a/l10n_it_fatturapa/bindings/fatturapa.py | ||
+++ b/l10n_it_fatturapa/bindings/fatturapa.py | ||
@@ -1,15 +1,19 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
-import pyxb.binding | ||
from odoo.modules.module import get_module_resource | ||
- | ||
from lxml import etree | ||
-from binding import * # noqa: F403 | ||
|
||
_logger = logging.getLogger(__name__) | ||
_logger.setLevel(logging.DEBUG) | ||
|
||
+try: | ||
+ import pyxb.binding | ||
+except (ImportError) as err: | ||
+ _logger.debug(err) | ||
+ | ||
+from .binding import * # noqa: F403 | ||
+ | ||
XSD_SCHEMA = 'Schema_del_file_xml_FatturaPA_versione_1.2.1.xsd' | ||
|
||
_xsd_schema = get_module_resource('l10n_it_fatturapa', 'bindings', 'xsd', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters