]> git.ipfire.org Git - thirdparty/python-drafthorse.git/commitdiff
Fix style errors
authorRaphael Michel <mail@raphaelmichel.de>
Mon, 15 Oct 2018 21:51:27 +0000 (23:51 +0200)
committerRaphael Michel <mail@raphaelmichel.de>
Mon, 15 Oct 2018 21:51:27 +0000 (23:51 +0200)
demo.py [deleted file]
drafthorse/models/elements.py
drafthorse/models/fields.py
drafthorse/models/tradelines.py
tests/test_roundtrip.py

diff --git a/demo.py b/demo.py
deleted file mode 100644 (file)
index ba71c00..0000000
--- a/demo.py
+++ /dev/null
@@ -1,24 +0,0 @@
-from datetime import date
-
-from drafthorse.models.document import Document, IncludedNote
-from drafthorse.utils import prettify
-
-"""
-doc = Document()
-doc.context.guideline_parameter.id = "urn:ferd:CrossIndustryDocument:invoice:1p0:comfort"
-doc.header.id = "RE1337"
-doc.header.name = "RECHNUNG"
-doc.header.type_code = "380"
-doc.header.issue_date_time.value = date.today()
-doc.header.languages.add("de")
-n = IncludedNote()
-n.content.add("Test Node 1")
-n.content.add("Test Node 2")
-doc.header.notes.add(n)
-
-doc.trade.agreement.seller.name = "Lieferant GmbH"
-"""
-
-samplexml = open("sample.xml", "rb").read()
-doc = Document.parse(samplexml)
-print(prettify(doc.serialize()))
index c7fc2c22ac14c3c51157d387c99e9efde3c06776..16c5b441fbf97c83a32dce05cc2e632e7c2bfe98 100644 (file)
@@ -1,16 +1,14 @@
 import sys
-from decimal import Decimal
-
-from datetime import date, datetime
-
 import xml.etree.cElementTree as ET
 from collections import OrderedDict
+from datetime import datetime
+from decimal import Decimal
 
 from drafthorse.utils import validate_xml
 
 from . import NS_UDT
-from .fields import Field
 from .container import Container
+from .fields import Field
 
 
 class BaseElementMeta(type):
index 0da21fe164bb38b7717559c2ff94cc07457b39d1..c50d8a3196d0b21d682044c4cfcd4f3b285e456f 100644 (file)
@@ -1,5 +1,6 @@
-from .container import Container, StringContainer, CurrencyContainer, IDContainer
 from . import BASIC
+from .container import (Container, CurrencyContainer, IDContainer,
+                        StringContainer)
 
 
 class Field:
index d4d3d0b9a71339524df98c05a617f410260d5d30..b60e1a092819718a353cfbb9a27109b4612be7a4 100644 (file)
@@ -1,6 +1,6 @@
 from . import BASIC, COMFORT, EXTENDED, NS_RAM
-from .accounting import (AccountingAccount, BillingSpecifiedPeriod,
-                         TradeAllowanceCharge, ApplicableTradeTax)
+from .accounting import (AccountingAccount, ApplicableTradeTax,
+                         BillingSpecifiedPeriod, TradeAllowanceCharge)
 from .delivery import SupplyChainEvent
 from .elements import Element
 from .fields import (CurrencyField, Field, MultiField, QuantityField,
index c4bb25f56546d0d26560f8d8571a901556a39c3d..e358e9301c8a584b8553d33971865033b437e0e2 100644 (file)
@@ -15,4 +15,4 @@ def test_sample_roundtrip(filename):
     origxml = prettify(open(os.path.join(os.path.dirname(__file__), 'samples', filename), 'r').read())
     doc = Document.parse(origxml)
     generatedxml = prettify(doc.serialize())
-    assert generatedxml.decode().strip() == origxml.decode().strip()
\ No newline at end of file
+    assert generatedxml.decode().strip() == origxml.decode().strip()