Browse Source

Merge pull request #130 from gurneyalex/8.0-fix_W503

fix pep8 W503
pull/93/merge
Yannick Vaucher 10 years ago
parent
commit
15752cc981
  1. 5
      __unported__/users_ldap_groups/users_ldap_groups.py
  2. 5
      database_cleanup/model/purge_columns.py
  3. 6
      database_cleanup/model/purge_tables.py
  4. 5
      mass_editing/models/ir_model_fields.py
  5. 4
      mass_editing/models/mass_object.py
  6. 28
      mass_editing/wizard/mass_editing_wizard.py
  7. 3
      server_environment/serv_config.py

5
__unported__/users_ldap_groups/users_ldap_groups.py

@ -34,8 +34,9 @@ class CompanyLDAPGroupMapping(orm.Model):
operators = [] operators = []
members = inspect.getmembers( members = inspect.getmembers(
users_ldap_groups_operators, users_ldap_groups_operators,
lambda cls: inspect.isclass(cls)
and cls != users_ldap_groups_operators.LDAPOperator)
lambda cls:
inspect.isclass(cls) and
cls != users_ldap_groups_operators.LDAPOperator)
for name, operator in members: for name, operator in members:
operators.append((name, name)) operators.append((name, name))
return tuple(operators) return tuple(operators)

5
database_cleanup/model/purge_columns.py

@ -96,8 +96,9 @@ class CleanupPurgeWizardColumn(orm.TransientModel):
columns = list(set([ columns = list(set([
column for model_pool in model_pools column for model_pool in model_pools
for column in model_pool._columns for column in model_pool._columns
if not (isinstance(model_pool._columns[column], fields.function)
and not model_pool._columns[column].store)
if not (isinstance(model_pool._columns[column],
fields.function) and
not model_pool._columns[column].store)
])) ]))
columns += orm.MAGIC_COLUMNS columns += orm.MAGIC_COLUMNS
columns += self.blacklist.get(model_pools[0]._table, []) columns += self.blacklist.get(model_pools[0]._table, [])

6
database_cleanup/model/purge_tables.py

@ -110,9 +110,9 @@ class CleanupPurgeWizardTable(orm.TransientModel):
known_tables += [ known_tables += [
column._sql_names(model_pool)[0] column._sql_names(model_pool)[0]
for column in model_pool._columns.values() for column in model_pool._columns.values()
if column._type == 'many2many'
# unstored function fields of type m2m don't have _rel
and hasattr(column, '_rel')
if (column._type == 'many2many' and
hasattr(column, '_rel')) # unstored function fields of
# type m2m don't have _rel
] ]
# Cannot pass table names as a psycopg argument # Cannot pass table names as a psycopg argument

5
mass_editing/models/ir_model_fields.py

@ -31,8 +31,9 @@ class IrModelFields(orm.Model):
count=False): count=False):
model_domain = [] model_domain = []
for domain in args: for domain in args:
if (len(domain) > 2 and domain[0] == 'model_id'
and isinstance(domain[2], basestring)):
if (len(domain) > 2 and
domain[0] == 'model_id' and
isinstance(domain[2], basestring)):
model_domain += [ model_domain += [
('model_id', 'in', map(int, domain[2][1:-1].split(','))) ('model_id', 'in', map(int, domain[2][1:-1].split(',')))
] ]

4
mass_editing/models/mass_object.py

@ -93,8 +93,8 @@ class MassObject(orm.Model):
'model': src_obj, 'model': src_obj,
'key2': 'client_action_multi', 'key2': 'client_action_multi',
'value': ( 'value': (
"ir.actions.act_window,"
+ str(vals['ref_ir_act_window'])),
"ir.actions.act_window," +
str(vals['ref_ir_act_window'])),
'object': True, 'object': True,
}, },
context) context)

28
mass_editing/wizard/mass_editing_wizard.py

@ -67,8 +67,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'colspan': '4', 'nolabel': '1', 'name': field.name, 'colspan': '4', 'nolabel': '1',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove_m2m')]}")})
"{'invisible':[('selection__" +
field.name + "','=','remove_m2m')]}")})
elif field.ttype == "one2many": elif field.ttype == "one2many":
all_fields["selection__" + field.name] = { all_fields["selection__" + field.name] = {
'type': 'selection', 'type': 'selection',
@ -82,8 +82,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'colspan': '4', 'nolabel': '1', 'name': field.name, 'colspan': '4', 'nolabel': '1',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove_o2m')]}")})
"{'invisible':[('selection__" +
field.name + "','=','remove_o2m')]}")})
elif field.ttype == "many2one": elif field.ttype == "many2one":
all_fields["selection__" + field.name] = { all_fields["selection__" + field.name] = {
'type': 'selection', 'type': 'selection',
@ -97,8 +97,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'nolabel': '1', 'colspan': '2', 'name': field.name, 'nolabel': '1', 'colspan': '2',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove')]}")})
"{'invisible':[('selection__" +
field.name + "','=','remove')]}")})
elif field.ttype == "char": elif field.ttype == "char":
all_fields["selection__" + field.name] = { all_fields["selection__" + field.name] = {
'type': 'selection', 'type': 'selection',
@ -114,8 +114,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'nolabel': '1', 'name': field.name, 'nolabel': '1',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove')]}"),
"{'invisible':[('selection__" +
field.name + "','=','remove')]}"),
'colspan': '2'}) 'colspan': '2'})
elif field.ttype == 'selection': elif field.ttype == 'selection':
all_fields["selection__" + field.name] = { all_fields["selection__" + field.name] = {
@ -127,8 +127,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'nolabel': '1', 'colspan': '2', 'name': field.name, 'nolabel': '1', 'colspan': '2',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove')]}")})
"{'invisible':[('selection__" +
field.name + "','=','remove')]}")})
all_fields[field.name] = { all_fields[field.name] = {
'type': field.ttype, 'type': field.ttype,
'string': field.field_description, 'string': field.field_description,
@ -152,8 +152,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'colspan': '4', 'nolabel': '1', 'name': field.name, 'colspan': '4', 'nolabel': '1',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove')]}")})
"{'invisible':[('selection__" +
field.name + "','=','remove')]}")})
else: else:
all_fields["selection__" + field.name] = { all_fields["selection__" + field.name] = {
'type': 'selection', 'type': 'selection',
@ -166,8 +166,8 @@ class MassEditingWizard(orm.TransientModel):
etree.SubElement(xml_group, 'field', { etree.SubElement(xml_group, 'field', {
'name': field.name, 'nolabel': '1', 'name': field.name, 'nolabel': '1',
'attrs': ( 'attrs': (
"{'invisible':[('selection__"
+ field.name + "','=','remove')]}"),
"{'invisible':[('selection__" +
field.name + "','=','remove')]}"),
'colspan': '2', }) 'colspan': '2', })
etree.SubElement( etree.SubElement(
xml_form, 'separator', {'string': '', 'colspan': '4'}) xml_form, 'separator', {'string': '', 'colspan': '4'})

3
server_environment/serv_config.py

@ -108,7 +108,8 @@ class _Defaults(dict):
__slots__ = () __slots__ = ()
def __setitem__(self, key, value): def __setitem__(self, key, value):
func = lambda *a: str(value)
def func(*a):
return str(value)
return dict.__setitem__(self, key, func) return dict.__setitem__(self, key, func)

Loading…
Cancel
Save