Browse Source

Merge pull request #11 from yvaucher/7.0-pep8-server-environment

[PEP8] server_environment
pull/17/head
Yannick Vaucher 11 years ago
parent
commit
d55d49fc05
  1. 6
      server_environment/serv_config.py

6
server_environment/serv_config.py

@ -23,7 +23,7 @@ import os
import ConfigParser import ConfigParser
from lxml import etree from lxml import etree
from openerp.osv import osv, fields, orm
from openerp.osv import fields, orm
from openerp.tools.config import config as system_base_config from openerp.tools.config import config as system_base_config
from .system_info import get_server_environment from .system_info import get_server_environment
@ -52,6 +52,7 @@ if not os.path.exists(ck_path) :
"please add a folder %s" % ck_path "please add a folder %s" % ck_path
) )
def setboolean(obj, attr, _bool=_boolean_states): def setboolean(obj, attr, _bool=_boolean_states):
"""Replace the attribute with a boolean.""" """Replace the attribute with a boolean."""
res = _bool[getattr(obj, attr).lower()] res = _bool[getattr(obj, attr).lower()]
@ -115,7 +116,7 @@ class ServerConfiguration(orm.TransientModel):
_conf_defaults = _Defaults() _conf_defaults = _Defaults()
def __init__(self, pool, cr): def __init__(self, pool, cr):
res = super(ServerConfiguration, self).__init__(pool, cr)
super(ServerConfiguration, self).__init__(pool, cr)
self.running_env = system_base_config['running_env'] self.running_env = system_base_config['running_env']
# Only show passwords in development # Only show passwords in development
self.show_passwords = self.running_env in ('dev',) self.show_passwords = self.running_env in ('dev',)
@ -187,7 +188,6 @@ class ServerConfiguration(orm.TransientModel):
res['fields'] = xfields res['fields'] = xfields
return res return res
def default_get(self, cr, uid, fields_list, context=None): def default_get(self, cr, uid, fields_list, context=None):
res = {} res = {}
for key in self._conf_defaults: for key in self._conf_defaults:

Loading…
Cancel
Save