Skip to content

Commit

Permalink
[FIX] l10n_it_fatturapa_in: compatibility with xmlschema 1.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMule71 committed Feb 24, 2021
1 parent 0af3c94 commit 13dc44f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions l10n_it_fatturapa_in/wizard/efattura.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import logging
import re
from collections.abc import MutableMapping
from datetime import datetime

import xmlschema
Expand Down Expand Up @@ -164,9 +165,9 @@ def _fix_xmlstring(xml_string):
return xml_string.encode()


def CreateFromDocument(xml_string):
def CreateFromDocument(xml_string): # noqa: C901
# il codice seguente rimpiazza fatturapa.CreateFromDocument(xml_string)
class ObjectDict(object):
class ObjectDict(MutableMapping):
def __getattr__(self, attr):
try:
return getattr(self.__dict__, attr)
Expand All @@ -179,6 +180,15 @@ def __getitem__(self, *attr, **kwattr):
def __setitem__(self, *attr, **kwattr):
return self.__dict__.__setitem__(*attr, **kwattr)

def __delitem__(self, *attr, **kwattr):
return self.__dict__.__delitem__(*attr, **kwattr)

def __iter__(self, *attr, **kwattr):
return self.__dict__.__iter__(*attr, **kwattr)

def __len__(self, *attr, **kwattr):
return self.__dict__.__len__(*attr, **kwattr)

# TODO: crearlo una tantum?
validator = xmlschema.XMLSchema(
_xml_schema_1_2_1,
Expand Down

0 comments on commit 13dc44f

Please sign in to comment.