Browse Source

[FIX] PEP8 and file permission issues

pull/4/head
Maxime Chambreuil 11 years ago
parent
commit
6ef83da9ac
  1. 0
      base_external_dbsource/__init__.py
  2. 27
      base_external_dbsource/base_external_dbsource.py
  3. 0
      base_external_dbsource/base_external_dbsource_demo.xml
  4. 0
      base_external_dbsource/security/ir.model.access.csv
  5. 0
      base_external_dbsource/test/dbsource_connect.yml
  6. 0
      import_odbc/__init__.py
  7. 4
      import_odbc/import_odbc.py
  8. 0
      import_odbc/import_odbc_demo.xml

0
base_external_dbsource/__init__.py

27
base_external_dbsource/base_external_dbsource.py

@ -30,20 +30,22 @@ CONNECTORS = []
try: try:
import sqlalchemy import sqlalchemy
CONNECTORS.append(('sqlite', 'SQLite'))
try:
import pymssql import pymssql
CONNECTORS.append(('mssql', 'Microsoft SQL Server')) CONNECTORS.append(('mssql', 'Microsoft SQL Server'))
except: except:
_logger.info('MS SQL Server not available. Please install "slqalchemy"\
and "pymssql" python package.')
_logger.info('MS SQL Server not available. Please install "pymssql"\
python package.')
try: try:
import sqlalchemy
import MySQLdb import MySQLdb
CONNECTORS.append(('mysql', 'MySQL')) CONNECTORS.append(('mysql', 'MySQL'))
except: except:
_logger.info('MySQL not available. Please install "slqalchemy" and\
"mysqldb" python package.')
_logger.info('MySQL not available. Please install "mysqldb"\
python package.')
except:
_logger.info('SQL Alchemy not available. Please install "slqalchemy"\
python package.')
try: try:
import pyodbc import pyodbc
CONNECTORS.append(('pyodbc', 'ODBC')) CONNECTORS.append(('pyodbc', 'ODBC'))
@ -61,13 +63,6 @@ except:
import psycopg2 import psycopg2
CONNECTORS.append(('postgresql', 'PostgreSQL')) CONNECTORS.append(('postgresql', 'PostgreSQL'))
try:
import sqlalchemy
CONNECTORS.append(('sqlite', 'SQLite'))
except:
_logger.info('SQLAlchemy not available. Please install "slqalchemy" python\
package.')
class base_external_dbsource(orm.Model): class base_external_dbsource(orm.Model):
_name = "base.external.dbsource" _name = "base.external.dbsource"
@ -163,7 +158,7 @@ Sample connection strings:
try: try:
conn = self.conn_open(cr, uid, obj.id) conn = self.conn_open(cr, uid, obj.id)
except Exception, e: except Exception, e:
raise osv.except_osv(_("Connection test failed!"),
raise orm.except_orm(_("Connection test failed!"),
_("Here is what we got instead:\n %s") _("Here is what we got instead:\n %s")
% tools.ustr(e)) % tools.ustr(e))
finally: finally:
@ -174,7 +169,7 @@ Sample connection strings:
# ignored, just a consequence of the previous exception # ignored, just a consequence of the previous exception
pass pass
#TODO: if OK a (wizard) message box should be displayed #TODO: if OK a (wizard) message box should be displayed
raise osv.except_osv(_("Connection test succeeded!"),
raise orm.except_orm(_("Connection test succeeded!"),
_("Everything seems properly set up!")) _("Everything seems properly set up!"))
#EOF #EOF

0
base_external_dbsource/base_external_dbsource_demo.xml

0
base_external_dbsource/security/ir.model.access.csv

0
base_external_dbsource/test/dbsource_connect.yml

0
import_odbc/__init__.py

4
import_odbc/import_odbc.py

@ -40,7 +40,9 @@ class import_odbc_dbtable(orm.Model):
'model_target': fields.many2one('ir.model', 'Target object'), 'model_target': fields.many2one('ir.model', 'Target object'),
'noupdate': fields.boolean('No updates', help="Only create new records; disable updates to existing records."), 'noupdate': fields.boolean('No updates', help="Only create new records; disable updates to existing records."),
'exec_order': fields.integer('Execution order', help="Defines the order to perform the import"), 'exec_order': fields.integer('Execution order', help="Defines the order to perform the import"),
'last_sync': fields.datetime('Last sync date', help="Datetime for the last succesfull sync. Later changes on the source may not be replicated on the destination"),
'last_sync': fields.datetime('Last sync date',
help="Datetime for the last succesfull sync."
"\nLater changes on the source may not be replicated on the destination"),
'start_run': fields.datetime('Time started', readonly=True), 'start_run': fields.datetime('Time started', readonly=True),
'last_run': fields.datetime('Time ended', readonly=True), 'last_run': fields.datetime('Time ended', readonly=True),
'last_record_count': fields.integer('Last record count', readonly=True), 'last_record_count': fields.integer('Last record count', readonly=True),

0
import_odbc/import_odbc_demo.xml

Loading…
Cancel
Save