Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes some typos (Issue #10) #11

Merged
merged 2 commits into from
Sep 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions drafthorse/models/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
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:
Expand Down Expand Up @@ -135,7 +135,7 @@
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
Expand Down Expand Up @@ -165,7 +165,7 @@
return node

def __str__(self):
return self.value
return self._value

def from_etree(self, root):
self._value = Decimal(root.text)
Expand Down Expand Up @@ -217,7 +217,7 @@
return self

def __str__(self):
return "{} {}".format(self.amount, self.currency)
return "{} {}".format(self._amount, self._currency)


class ClassificationElement(StringElement):
Expand All @@ -229,7 +229,7 @@

def to_etree(self):
node = self._etree_node()
node.text = self.text
node.text = self._text

Check warning on line 232 in drafthorse/models/elements.py

View check run for this annotation

Codecov / codecov/patch

drafthorse/models/elements.py#L232

Added line #L232 was not covered by tests
node.attrib["listID"] = self._list_id
node.attrib["listVersionID"] = self._list_version_id
return node
Expand Down Expand Up @@ -267,7 +267,7 @@
return self

def __str__(self):
return "{} ({} {})".format(self._text, self._mime_code)
return "{} ({} {})".format(self._text, self._filename, self._mime_code)


class AgencyIDElement(StringElement):
Expand Down
2 changes: 0 additions & 2 deletions drafthorse/models/tradelines.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from . import BASIC, COMFORT, EXTENDED, NS_RAM
from .accounting import (
AccountingAccount,
ApplicableTradeTax,
BillingSpecifiedPeriod,
ReceivableAccountingAccount,
Expand All @@ -9,7 +8,6 @@
from .delivery import SupplyChainEvent
from .elements import Element
from .fields import (
DateTimeField,
DecimalField,
Field,
MultiField,
Expand Down
2 changes: 1 addition & 1 deletion drafthorse/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def _prepare_pdf_metadata_xml(level, pdf_metadata):
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
Expand Down
Loading