From 492ffa9f5abddfa09dc427124ee441202f5d759c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 2 Dec 2014 12:54:29 +0100 Subject: [PATCH] Fix most flake8 errors review8771002 --- __init__.py | 4 ++-- account.py | 4 ++-- configuration.py | 4 ++-- fiscalyear.py | 8 ++++---- journal.py | 4 ++-- move.py | 14 +++++++------- party.py | 4 ++-- period.py | 10 +++++----- setup.py | 4 ++-- tax.py | 6 +++--- tests/__init__.py | 4 ++-- tests/test_account.py | 4 ++-- tests/tools.py | 4 ++-- 13 files changed, 37 insertions(+), 37 deletions(-) diff --git a/__init__.py b/__init__.py index dae32351aa..803d55437e 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from trytond.pool import Pool from .fiscalyear import * diff --git a/account.py b/account.py index 4704f5b5b4..080dbf74ee 100644 --- a/account.py +++ b/account.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from decimal import Decimal import datetime import operator diff --git a/configuration.py b/configuration.py index b7bab77023..f94dfd658f 100644 --- a/configuration.py +++ b/configuration.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, ModelSingleton, fields from trytond.pool import Pool from trytond.transaction import Transaction diff --git a/fiscalyear.py b/fiscalyear.py index f98d0b1547..ded783443c 100644 --- a/fiscalyear.py +++ b/fiscalyear.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from dateutil.relativedelta import relativedelta from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard, StateView, StateTransition, StateAction, \ @@ -270,8 +270,8 @@ class FiscalYear(ModelSQL, ModelView): ]): cls.raise_user_error('close_error', (fiscalyear.rec_name,)) - #First close the fiscalyear to be sure - #it will not have new period created between. + # First close the fiscalyear to be sure + # it will not have new period created between. cls.write([fiscalyear], { 'state': 'close', }) diff --git a/journal.py b/journal.py index f02ea31be7..d2cff6a788 100644 --- a/journal.py +++ b/journal.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from sql import Null from trytond.model import ModelView, ModelSQL, fields diff --git a/move.py b/move.py index 6053cd02e5..507746cd80 100644 --- a/move.py +++ b/move.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from decimal import Decimal import datetime from itertools import groupby, combinations @@ -570,8 +570,8 @@ class Line(ModelSQL, ModelView): 'get_move_field', setter='set_move_field', searcher='search_move_field') amount_second_currency = fields.Numeric('Amount Second Currency', - digits=(16, Eval('second_currency_digits', 2)), - help='The amount expressed in a second currency', + digits=(16, Eval('second_currency_digits', 2)), + help='The amount expressed in a second currency', states={ 'required': Bool(Eval('second_currency')), }, @@ -588,7 +588,7 @@ class Line(ModelSQL, ModelView): 'invisible': ~Eval('party_required', False), }, depends=['party_required']) - party_required= fields.Function(fields.Boolean('Party Required'), + party_required = fields.Function(fields.Boolean('Party Required'), 'on_change_with_party_required') maturity_date = fields.Date('Maturity Date', help='This field is used for payable and receivable lines. \n' @@ -720,7 +720,7 @@ class Line(ModelSQL, ModelView): with_rec_name=with_rec_name) if 'move' not in fields: - #Not manual entry + # Not manual entry if 'date' in values: values = values.copy() del values['date'] @@ -949,7 +949,7 @@ class Line(ModelSQL, ModelView): TaxLine = pool.get('account.tax.line') if self.move: - #Only for first line + # Only for first line return tax_lines = [] if self.account: diff --git a/party.py b/party.py index e115cf5042..ffa0d53f88 100644 --- a/party.py +++ b/party.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from decimal import Decimal from sql import Literal, Null diff --git a/period.py b/period.py index 7d5dd1a684..04474de0db 100644 --- a/period.py +++ b/period.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from trytond.model import ModelView, ModelSQL, fields from trytond.wizard import Wizard, StateTransition from trytond.pyson import Eval @@ -295,10 +295,10 @@ class Period(ModelSQL, ModelView): unposted_move, = unposted_moves cls.raise_user_error('close_period_non_posted_move', { 'period': unposted_move.period.rec_name, - 'move': unposted_move.rec_name, + 'move': unposted_move.rec_name, }) - #First close the period to be sure - #it will not have new journal.period created between. + # First close the period to be sure + # it will not have new journal.period created between. cls.write(periods, { 'state': 'close', }) diff --git a/setup.py b/setup.py index 5df5a4816b..ffcd106002 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ #!/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. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from setuptools import setup import re diff --git a/tax.py b/tax.py index 5386c27293..bbfc2a5c53 100644 --- a/tax.py +++ b/tax.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# 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 datetime from decimal import Decimal @@ -407,7 +407,7 @@ class TaxTemplate(ModelSQL, ModelView): # Migration from 1.0 group is no more required table.not_null_action('group', action='remove') - #Migration from 2.4: drop required on sequence + # Migration from 2.4: drop required on sequence table.not_null_action('sequence', action='remove') # Migration from 2.8: rename percentage into rate diff --git a/tests/__init__.py b/tests/__init__.py index 24b6dac707..0c2c72d0e4 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# This file is part of Tryton. The COPYRIGHT file at the top level of +# this repository contains the full copyright notices and license terms. from .test_account import suite diff --git a/tests/test_account.py b/tests/test_account.py index 1c5d54e616..e654edf479 100644 --- a/tests/test_account.py +++ b/tests/test_account.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# 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 unittest import doctest import datetime diff --git a/tests/tools.py b/tests/tools.py index 9c8dbdc4c9..381fa9541b 100644 --- a/tests/tools.py +++ b/tests/tools.py @@ -1,5 +1,5 @@ -#This file is part of Tryton. The COPYRIGHT file at the top level of -#this repository contains the full copyright notices and license terms. +# 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 datetime from dateutil.relativedelta import relativedelta