Browse Source

[PEP8] Misc

pull/21/head
Sandy Carter 11 years ago
committed by Sandy Carter
parent
commit
49975648a8
  1. 2
      auth_admin_passkey/model/res_users.py
  2. 3
      auth_from_http_basic/__init__.py
  3. 8
      base_external_dbsource/base_external_dbsource.py

2
auth_admin_passkey/model/res_users.py

@ -35,7 +35,7 @@ class res_users(Model):
# Private Function section # Private Function section
def _get_translation(self, cr, lang, text): def _get_translation(self, cr, lang, text):
context = {'lang': lang}
context = {'lang': lang} # noqa: _() checks page for locals
return _(text) return _(text)
def _send_email_passkey(self, cr, user_id, user_agent_env): def _send_email_passkey(self, cr, user_id, user_agent_env):

3
auth_from_http_basic/__init__.py

@ -36,7 +36,8 @@ def init(self, params):
base_location=self.httprequest.url_root.rstrip('/'), base_location=self.httprequest.url_root.rstrip('/'),
HTTP_HOST=self.httprequest.environ['HTTP_HOST'], HTTP_HOST=self.httprequest.environ['HTTP_HOST'],
REMOTE_ADDR=self.httprequest.environ['REMOTE_ADDR'] REMOTE_ADDR=self.httprequest.environ['REMOTE_ADDR']
))
)
)
WebRequest.init = init WebRequest.init = init

8
base_external_dbsource/base_external_dbsource.py

@ -34,13 +34,15 @@ try:
try: try:
import pymssql import pymssql
CONNECTORS.append(('mssql', 'Microsoft SQL Server')) CONNECTORS.append(('mssql', 'Microsoft SQL Server'))
except:
assert pymssql
except ImportError, AssertionError:
_logger.info('MS SQL Server not available. Please install "pymssql"\ _logger.info('MS SQL Server not available. Please install "pymssql"\
python package.') python package.')
try: try:
import MySQLdb import MySQLdb
CONNECTORS.append(('mysql', 'MySQL')) CONNECTORS.append(('mysql', 'MySQL'))
except:
assert MySQLdb
except ImportError, AssertionError:
_logger.info('MySQL not available. Please install "mysqldb"\ _logger.info('MySQL not available. Please install "mysqldb"\
python package.') python package.')
except: except:
@ -171,5 +173,3 @@ Sample connection strings:
# TODO: if OK a (wizard) message box should be displayed # TODO: if OK a (wizard) message box should be displayed
raise orm.except_orm(_("Connection test succeeded!"), raise orm.except_orm(_("Connection test succeeded!"),
_("Everything seems properly set up!")) _("Everything seems properly set up!"))
#EOF
Loading…
Cancel
Save