Browse Source

[7.0] [FIX] Pep8

pull/71/head
Sylvain LE GAL 10 years ago
parent
commit
a389276869
  1. 2
      auth_admin_passkey/__openerp__.py
  2. 2
      base_optional_quick_create/model.py
  3. 2
      cron_run_manually/__openerp__.py
  4. 2
      email_template_template/model/email_template.py
  5. 2
      fetchmail_attach_from_folder/__openerp__.py
  6. 2
      fetchmail_attach_from_folder/match_algorithm/email_domain.py
  7. 2
      fetchmail_attach_from_folder/model/fetchmail_server.py
  8. 4
      fetchmail_attach_from_folder/wizard/attach_mail_manually.py
  9. 9
      import_odbc/import_odbc.py
  10. 6
      mass_editing/mass_editing.py
  11. 2
      scheduler_error_mailer/ir_cron.py
  12. 5
      server_environment/serv_config.py
  13. 2
      super_calendar/__openerp__.py
  14. 9
      super_calendar/super_calendar.py
  15. 2
      users_ldap_groups/users_ldap_groups.py
  16. 3
      users_ldap_groups/users_ldap_groups_operators.py
  17. 6
      users_ldap_mail/users_ldap_model.py
  18. 4
      users_ldap_populate/__openerp__.py
  19. 2
      users_ldap_populate/model/populate_wizard.py
  20. 2
      users_ldap_populate/model/users_ldap.py

2
auth_admin_passkey/__openerp__.py

@ -49,7 +49,7 @@ Copyright, Author and Licence :
'license': 'AGPL-3', 'license': 'AGPL-3',
'depends': [ 'depends': [
'mail', 'mail',
],
],
'data': [ 'data': [
'data/ir_config_parameter.xml', 'data/ir_config_parameter.xml',
'view/res_config_view.xml', 'view/res_config_view.xml',

2
base_optional_quick_create/model.py

@ -29,7 +29,7 @@ class ir_model(orm.Model):
_columns = { _columns = {
'avoid_quick_create': fields.boolean('Avoid quick create'), 'avoid_quick_create': fields.boolean('Avoid quick create'),
}
}
def _wrap_name_create(self, old_create, model): def _wrap_name_create(self, old_create, model):
def wrapper(cr, uid, name, context=None): def wrapper(cr, uid, name, context=None):

2
cron_run_manually/__openerp__.py

@ -34,4 +34,4 @@ of the scheduler.
'depends': ['base'], 'depends': ['base'],
'data': ['view/ir_cron.xml'], 'data': ['view/ir_cron.xml'],
'installable': True, 'installable': True,
}
}

2
email_template_template/model/email_template.py

@ -40,7 +40,7 @@ class email_template(Model):
'is_template_template': fields.function( 'is_template_template': fields.function(
_get_is_template_template, type='boolean', _get_is_template_template, type='boolean',
string='Is a template template'), string='Is a template template'),
}
}
def get_email_template(self, cr, uid, template_id=False, record_id=None, def get_email_template(self, cr, uid, template_id=False, record_id=None,
context=None): context=None):

2
fetchmail_attach_from_folder/__openerp__.py

@ -38,7 +38,7 @@ client integration.
'view/fetchmail_server.xml', 'view/fetchmail_server.xml',
'wizard/attach_mail_manually.xml', 'wizard/attach_mail_manually.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
],
],
'js': [], 'js': [],
'installable': True, 'installable': True,
'active': False, 'active': False,

2
fetchmail_attach_from_folder/match_algorithm/email_domain.py

@ -40,6 +40,6 @@ class email_domain(email_exact):
self._get_mailaddress_search_domain( self._get_mailaddress_search_domain(
conf, mail_message, conf, mail_message,
operator='like', operator='like',
values=['%@'+domain for domain in set(domains)]),
values=['%@' + domain for domain in set(domains)]),
order=conf.model_order) order=conf.model_order)
return ids return ids

2
fetchmail_attach_from_folder/model/fetchmail_server.py

@ -182,7 +182,7 @@ class fetchmail_server(Model):
partner_id = self.pool.get( partner_id = self.pool.get(
folder.model_id.model).browse( folder.model_id.model).browse(
cr, uid, object_id, context cr, uid, object_id, context
).partner_id.id
).partner_id.id
attachments = [] attachments = []
if this.attach and mail_message.get('attachments'): if this.attach and mail_message.get('attachments'):

4
fetchmail_attach_from_folder/wizard/attach_mail_manually.py

@ -74,8 +74,8 @@ class attach_mail_manually(TransientModel):
'msgid': msgid, 'msgid': msgid,
'subject': mail_message.get('subject', ''), 'subject': mail_message.get('subject', ''),
'date': mail_message.get('date', ''), 'date': mail_message.get('date', ''),
'object_id': folder.model_id.model+',False'
}))
'object_id': folder.model_id.model + ',False'
}))
connection.close() connection.close()
return defaults return defaults

9
import_odbc/import_odbc.py

@ -67,8 +67,7 @@ class import_odbc_dbtable(orm.Model):
'last_log': fields.text('Last run log', readonly=True), 'last_log': fields.text('Last run log', readonly=True),
'ignore_rel_errors': fields.boolean( 'ignore_rel_errors': fields.boolean(
'Ignore relationship errors', 'Ignore relationship errors',
help="On error try to reimport rows ignoring relationships."
),
help="On error try to reimport rows ignoring relationships."),
'raise_import_errors': fields.boolean( 'raise_import_errors': fields.boolean(
'Raise import errors', 'Raise import errors',
help="Import errors not handled, intended for debugging purposes." help="Import errors not handled, intended for debugging purposes."
@ -95,7 +94,7 @@ class import_odbc_dbtable(orm.Model):
+ ': ' + ': '
+ obj_id.split('_')[-1]) + obj_id.split('_')[-1])
if ': .' in msg and not rel_id: if ': .' in msg and not rel_id:
rel_id = msg[msg.find(': .')+3:]
rel_id = msg[msg.find(': .') + 3:]
if '_id_' in rel_id: if '_id_' in rel_id:
rel_id = ('.'.join(rel_id.split('_')[:-2]) rel_id = ('.'.join(rel_id.split('_')[:-2])
+ ': ' + ': '
@ -251,7 +250,7 @@ class import_odbc_dbtable(orm.Model):
'function': 'import_run', 'function': 'import_run',
'doall': False, 'doall': False,
'active': True 'active': True
})
})
return { return {
'name': 'Import ODBC tables', 'name': 'Import ODBC tables',
'view_type': 'form', 'view_type': 'form',
@ -259,4 +258,4 @@ class import_odbc_dbtable(orm.Model):
'res_model': 'ir.cron', 'res_model': 'ir.cron',
'res_id': new_create_id, 'res_id': new_create_id,
'type': 'ir.actions.act_window', 'type': 'ir.actions.act_window',
}
}

6
mass_editing/mass_editing.py

@ -103,7 +103,7 @@ class mass_object(orm.Model):
'view_mode': 'form,tree', 'view_mode': 'form,tree',
'target': 'new', 'target': 'new',
'auto_refresh': 1, 'auto_refresh': 1,
}, context)
}, context)
vals['ref_ir_value'] = ir_values_obj.create(cr, uid, { vals['ref_ir_value'] = ir_values_obj.create(cr, uid, {
'name': button_name, 'name': button_name,
'model': src_obj, 'model': src_obj,
@ -112,11 +112,11 @@ class mass_object(orm.Model):
"ir.actions.act_window," "ir.actions.act_window,"
+ str(vals['ref_ir_act_window'])), + str(vals['ref_ir_act_window'])),
'object': True, 'object': True,
}, context)
}, context)
self.write(cr, uid, ids, { self.write(cr, uid, ids, {
'ref_ir_act_window': vals.get('ref_ir_act_window', False), 'ref_ir_act_window': vals.get('ref_ir_act_window', False),
'ref_ir_value': vals.get('ref_ir_value', False), 'ref_ir_value': vals.get('ref_ir_value', False),
}, context)
}, context)
return True return True
def unlink_action(self, cr, uid, ids, context=None): def unlink_action(self, cr, uid, ids, context=None):

2
scheduler_error_mailer/ir_cron.py

@ -58,7 +58,7 @@ class ir_cron(orm.Model):
context = { context = {
'job_exception': job_exception, 'job_exception': job_exception,
'dbname': cr.dbname, 'dbname': cr.dbname,
}
}
logger.debug("Sending scheduler error email with context=%s", logger.debug("Sending scheduler error email with context=%s",
context) context)

5
server_environment/serv_config.py

@ -172,8 +172,9 @@ class ServerConfiguration(orm.TransientModel):
arch += '</notebook></form>' arch += '</notebook></form>'
self._arch = etree.fromstring(arch) self._arch = etree.fromstring(arch)
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
context=None, toolbar=False, submenu=False):
def fields_view_get(
self, cr, uid, view_id=None, view_type='form', context=None,
toolbar=False, submenu=False):
"""Overwrite the default method to render the custom view.""" """Overwrite the default method to render the custom view."""
res = super(ServerConfiguration, self).fields_view_get(cr, uid, res = super(ServerConfiguration, self).fields_view_get(cr, uid,
view_id, view_id,

2
super_calendar/__openerp__.py

@ -80,7 +80,7 @@ add it to a dashboard.
'super_calendar_view.xml', 'super_calendar_view.xml',
'cron_data.xml', 'cron_data.xml',
'security/ir.model.access.csv', 'security/ir.model.access.csv',
],
],
'demo': [], 'demo': [],
'test': [], 'test': [],
'installable': True, 'installable': True,

9
super_calendar/super_calendar.py

@ -125,9 +125,9 @@ class super_calendar_configurator(orm.Model):
False False
), ),
'configurator_id': configurator.id, 'configurator_id': configurator.id,
'res_id': line.name.model+','+str(record['id']),
'res_id': line.name.model + ',' + str(record['id']),
'model_id': line.name.id, 'model_id': line.name.id,
}
}
return super_calendar_values return super_calendar_values
@ -142,15 +142,14 @@ class super_calendar_configurator_line(orm.Model):
'description_type': fields.selection([ 'description_type': fields.selection([
('field', 'Field'), ('field', 'Field'),
('code', 'Code'), ('code', 'Code'),
], string="Description Type"),
], string="Description Type"),
'description_field_id': fields.many2one( 'description_field_id': fields.many2one(
'ir.model.fields', 'Description field', 'ir.model.fields', 'Description field',
domain="[('model_id', '=', name),('ttype', '=', 'char')]"), domain="[('model_id', '=', name),('ttype', '=', 'char')]"),
'description_code': fields.text( 'description_code': fields.text(
'Description field', 'Description field',
help="Use '${o}' to refer to the involved object. " help="Use '${o}' to refer to the involved object. "
"E.g.: '${o.project_id.name}'"
),
"E.g.: '${o.project_id.name}'"),
'date_start_field_id': fields.many2one( 'date_start_field_id': fields.many2one(
'ir.model.fields', 'Start date field', 'ir.model.fields', 'Start date field',
domain="['&','|',('ttype', '=', 'datetime')," domain="['&','|',('ttype', '=', 'datetime'),"

2
users_ldap_groups/users_ldap_groups.py

@ -59,7 +59,7 @@ class CompanyLDAPGroupMapping(orm.Model):
'group': fields.many2one( 'group': fields.many2one(
'res.groups', 'OpenERP group', 'res.groups', 'OpenERP group',
help='The OpenERP group to assign', required=True), help='The OpenERP group to assign', required=True),
}
}
class CompanyLDAP(orm.Model): class CompanyLDAP(orm.Model):

3
users_ldap_groups/users_ldap_groups_operators.py

@ -57,8 +57,7 @@ class query(LDAPOperator):
logger): logger):
query_string = Template(value).safe_substitute(dict( query_string = Template(value).safe_substitute(dict(
[(attr, ldap_entry[1][attribute][0]) for attr in ldap_entry[1]] [(attr, ldap_entry[1][attribute][0]) for attr in ldap_entry[1]]
)
)
))
logger.debug('evaluating query group mapping, filter: %s', logger.debug('evaluating query group mapping, filter: %s',
query_string) query_string)
results = company.query(ldap_config, query_string) results = company.query(ldap_config, query_string)

6
users_ldap_mail/users_ldap_model.py

@ -35,11 +35,11 @@ class CompanyLDAP(orm.Model):
'mail_attribute': fields.char( 'mail_attribute': fields.char(
'E-mail attribute', size=64, 'E-mail attribute', size=64,
help="LDAP attribute to use to retrieve em-mail address."), help="LDAP attribute to use to retrieve em-mail address."),
}
}
_defaults = { _defaults = {
'name_attribute': 'cn', 'name_attribute': 'cn',
'mail_attribute': 'mail', 'mail_attribute': 'mail',
}
}
def get_ldap_dicts(self, cr, ids=None): def get_ldap_dicts(self, cr, ids=None):
""" """
@ -66,7 +66,7 @@ class CompanyLDAP(orm.Model):
mapping = [ mapping = [
('name', 'name_attribute'), ('name', 'name_attribute'),
('email', 'mail_attribute'), ('email', 'mail_attribute'),
]
]
for value_key, conf_name in mapping: for value_key, conf_name in mapping:
try: try:
if conf[conf_name]: if conf[conf_name]:

4
users_ldap_populate/__openerp__.py

@ -40,11 +40,11 @@ object you want to query.
""", """,
"depends": [ "depends": [
'auth_ldap', 'auth_ldap',
],
],
"data": [ "data": [
'view/users_ldap.xml', 'view/users_ldap.xml',
'view/populate_wizard.xml', 'view/populate_wizard.xml',
],
],
'installable': True, 'installable': True,
} }
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

2
users_ldap_populate/model/populate_wizard.py

@ -31,7 +31,7 @@ class CompanyLDAPPopulateWizard(orm.TransientModel):
'res.company.ldap', 'LDAP Configuration'), 'res.company.ldap', 'LDAP Configuration'),
'users_created': fields.integer( 'users_created': fields.integer(
'Number of users created', readonly=True), 'Number of users created', readonly=True),
}
}
def create(self, cr, uid, vals, context=None): def create(self, cr, uid, vals, context=None):
ldap_pool = self.pool.get('res.company.ldap') ldap_pool = self.pool.get('res.company.ldap')

2
users_ldap_populate/model/users_ldap.py

@ -93,4 +93,4 @@ class CompanyLDAP(orm.Model):
'target': 'new', 'target': 'new',
'res_id': res_id, 'res_id': res_id,
'nodestroy': True, 'nodestroy': True,
}
}
Loading…
Cancel
Save