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. 39
      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

39
base_external_dbsource/base_external_dbsource.py

@ -30,20 +30,22 @@ CONNECTORS = []
try:
import sqlalchemy
import pymssql
CONNECTORS.append(('mssql', 'Microsoft SQL Server'))
except:
_logger.info('MS SQL Server not available. Please install "slqalchemy"\
and "pymssql" python package.')
try:
import sqlalchemy
import MySQLdb
CONNECTORS.append(('mysql', 'MySQL'))
CONNECTORS.append(('sqlite', 'SQLite'))
try:
import pymssql
CONNECTORS.append(('mssql', 'Microsoft SQL Server'))
except:
_logger.info('MS SQL Server not available. Please install "pymssql"\
python package.')
try:
import MySQLdb
CONNECTORS.append(('mysql', 'MySQL'))
except:
_logger.info('MySQL not available. Please install "mysqldb"\
python package.')
except:
_logger.info('MySQL not available. Please install "slqalchemy" and\
"mysqldb" python package.')
_logger.info('SQL Alchemy not available. Please install "slqalchemy"\
python package.')
try:
import pyodbc
CONNECTORS.append(('pyodbc', 'ODBC'))
@ -61,13 +63,6 @@ except:
import psycopg2
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):
_name = "base.external.dbsource"
@ -163,7 +158,7 @@ Sample connection strings:
try:
conn = self.conn_open(cr, uid, obj.id)
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")
% tools.ustr(e))
finally:
@ -174,7 +169,7 @@ Sample connection strings:
# ignored, just a consequence of the previous exception
pass
#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!"))
#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'),
'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"),
'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),
'last_run': fields.datetime('Time ended', readonly=True),
'last_record_count': fields.integer('Last record count', readonly=True),

0
import_odbc/import_odbc_demo.xml

Loading…
Cancel
Save