if child.tag == ET.Comment:
continue
if child.tag in field_index:
- name, childel = field_index[child.tag]
+ name, _childel = field_index[child.tag]
if isinstance(getattr(self, name), Container):
getattr(self, name).add_from_etree(child)
else:
return "<{}: {}>".format(type(self).__name__, str(self))
def __str__(self):
- return str(self.text)
+ return str(self._text)
def is_empty(self, el):
return super().is_empty(el) and not self._set_on_input
return node
def __str__(self):
- return self.value
+ return self._value
def from_etree(self, root):
self._value = Decimal(root.text)
return self
def __str__(self):
- return "{} {}".format(self.amount, self.currency)
+ return "{} {}".format(self._amount, self._currency)
class ClassificationElement(StringElement):
def to_etree(self):
node = self._etree_node()
- node.text = self.text
+ node.text = self._text
node.attrib["listID"] = self._list_id
node.attrib["listVersionID"] = self._list_version_id
return node
return self
def __str__(self):
- return "{} ({} {})".format(self._text, self._mime_code)
+ return "{} ({} {})".format(self._text, self._filename, self._mime_code)
class AgencyIDElement(StringElement):
from . import BASIC, COMFORT, EXTENDED, NS_RAM
from .accounting import (
- AccountingAccount,
ApplicableTradeTax,
BillingSpecifiedPeriod,
ReceivableAccountingAccount,
from .delivery import SupplyChainEvent
from .elements import Element
from .fields import (
- DateTimeField,
DecimalField,
Field,
MultiField,
xmp_file = os.path.join(
os.path.dirname(__file__),
"schema",
- "ZUGFeRD2p2_extension_schema.xmp".format(level),
+ "ZUGFeRD2p2_extension_schema.xmp",
)
# Reason for defining a parser below:
# http://lxml.de/FAQ.html#why-doesn-t-the-pretty-print-option-reformat-my-xml-output