From 5345defdfc8f1114cadcd9014fbd6dfc419075f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 3 Apr 2012 20:07:41 +0200 Subject: [PATCH] Fix pep8 and pyflakes --- __tryton__.py | 10 +++++----- sale.py | 7 ++++--- stock.py | 2 +- tests/test_sale_shipment_cost.py | 5 ++++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/__tryton__.py b/__tryton__.py index 013ba87ac8..3274f31299 100644 --- a/__tryton__.py +++ b/__tryton__.py @@ -2,12 +2,12 @@ #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. { - 'name' : 'Sale Shipment Cost', + 'name': 'Sale Shipment Cost', 'name_de_DE': 'Verkauf Lieferposten Kosten', 'name_es_ES': 'Costo del método de envio', 'name_fr_FR': "Coût d'expédition de vente", - 'version' : '2.3.0', - 'author' : 'B2CK', + 'version': '2.3.0', + 'author': 'B2CK', 'email': 'info@b2ck.com', 'website': 'http://www.tryton.org/', 'description': 'Add sale shipment cost', @@ -16,7 +16,7 @@ ''', 'description_fr_FR': "Ajoute le coût d'expédition sur les ventes", 'description_es_ES': "Agrega un costo al método de envio.", - 'depends' : [ + 'depends': [ 'ir', 'res', 'carrier', @@ -25,7 +25,7 @@ 'account_invoice', 'stock', ], - 'xml' : [ + 'xml': [ 'sale.xml', 'stock.xml', ], diff --git a/sale.py b/sale.py index c505ef4f70..ff49c5ccbc 100644 --- a/sale.py +++ b/sale.py @@ -124,13 +124,13 @@ class Sale(Model): 'type': 'line', 'product': product.id, 'description': description, - 'quantity': 1, #XXX + 'quantity': 1, # XXX 'unit': product.sale_uom.id, 'unit_price': cost, 'shipment_cost': cost, 'amount': cost, 'taxes': taxes, - 'sequence': 9999, #XXX + 'sequence': 9999, # XXX } pattern = sale_line_obj._get_tax_rule_pattern(party, cost_line) @@ -191,7 +191,8 @@ class Sale(Model): shipment_obj.get_carrier_context(shipment, values={ 'carrier': sale.carrier.id, })): - cost, currency_id = carrier_obj.get_sale_price(sale.carrier) + cost, currency_id = carrier_obj.get_sale_price( + sale.carrier) with Transaction().set_user(0, set_context=True): shipment_obj.write(shipment.id, { 'carrier': sale.carrier.id, diff --git a/stock.py b/stock.py index e83703819f..ca9e9ddb1e 100644 --- a/stock.py +++ b/stock.py @@ -130,7 +130,7 @@ class ShipmentOut(Model): with Transaction().set_context(party_context): values['description'] = product_obj.browse(product.id).rec_name - values['quantity'] = 1 # XXX + values['quantity'] = 1 # XXX values['unit'] = product.sale_uom.id cost = shipment.cost if invoice.currency != shipment.cost_currency: diff --git a/tests/test_sale_shipment_cost.py b/tests/test_sale_shipment_cost.py index ea08c384ef..5e0b43aee6 100644 --- a/tests/test_sale_shipment_cost.py +++ b/tests/test_sale_shipment_cost.py @@ -1,7 +1,8 @@ #!/usr/bin/env python #This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. -import sys, os +import sys +import os DIR = os.path.abspath(os.path.normpath(os.path.join(__file__, '..', '..', '..', '..', '..', 'trytond'))) if os.path.isdir(DIR): @@ -34,6 +35,7 @@ class SaleShipmentCostTestCase(unittest.TestCase): ''' test_depends() + def doctest_dropdb(test): ''' Remove sqlite memory database @@ -46,6 +48,7 @@ def doctest_dropdb(test): finally: cursor.close() + def suite(): suite = trytond.tests.test_tryton.suite() suite.addTests(unittest.TestLoader().loadTestsFromTestCase(