[REF] remove unused import, always import literal_eval from tools.safe_eval.
bzr revid: florent.xicluna@gmail.com-20120115214214-0rjwn80choc9g0fs
This commit is contained in:
parent
9b02aed518
commit
40c1de87d8
|
@ -18,7 +18,6 @@
|
||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
import ast
|
|
||||||
import copy
|
import copy
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
@ -31,7 +30,7 @@ import netsvc
|
||||||
from osv import fields,osv
|
from osv import fields,osv
|
||||||
from report.report_sxw import report_sxw, report_rml
|
from report.report_sxw import report_sxw, report_rml
|
||||||
from tools.config import config
|
from tools.config import config
|
||||||
from tools.safe_eval import safe_eval as eval
|
from tools.safe_eval import safe_eval as eval, literal_eval
|
||||||
from tools.translate import _
|
from tools.translate import _
|
||||||
from socket import gethostname
|
from socket import gethostname
|
||||||
|
|
||||||
|
@ -920,7 +919,7 @@ class act_client(osv.osv):
|
||||||
|
|
||||||
def _get_params(self, cr, uid, ids, field_name, arg, context):
|
def _get_params(self, cr, uid, ids, field_name, arg, context):
|
||||||
return dict([
|
return dict([
|
||||||
((record.id, ast.literal_eval(record.params_store))
|
((record.id, literal_eval(record.params_store))
|
||||||
if record.params_store else (record.id, False))
|
if record.params_store else (record.id, False))
|
||||||
for record in self.browse(cr, uid, ids, context=context)
|
for record in self.browse(cr, uid, ids, context=context)
|
||||||
])
|
])
|
||||||
|
|
|
@ -30,7 +30,6 @@ import socket
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import time
|
import time
|
||||||
import traceback
|
|
||||||
import types
|
import types
|
||||||
from pprint import pformat
|
from pprint import pformat
|
||||||
|
|
||||||
|
|
|
@ -39,21 +39,17 @@
|
||||||
static HTTP, DAV or other.
|
static HTTP, DAV or other.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from websrv_lib import *
|
import base64
|
||||||
import openerp.netsvc as netsvc
|
|
||||||
import errno
|
|
||||||
import threading
|
|
||||||
import openerp.tools as tools
|
|
||||||
import posixpath
|
import posixpath
|
||||||
import urllib
|
import urllib
|
||||||
import os
|
import os
|
||||||
import select
|
|
||||||
import socket
|
|
||||||
import xmlrpclib
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
|
from SimpleXMLRPCServer import SimpleXMLRPCDispatcher
|
||||||
|
|
||||||
|
from websrv_lib import *
|
||||||
|
import openerp.netsvc as netsvc
|
||||||
|
import openerp.tools as tools
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import fcntl
|
import fcntl
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
@ -39,6 +39,7 @@ import openerp.sql_db as sql_db
|
||||||
import openerp.tools as tools
|
import openerp.tools as tools
|
||||||
import openerp.modules
|
import openerp.modules
|
||||||
import openerp.exceptions
|
import openerp.exceptions
|
||||||
|
from openerp.service import http_server
|
||||||
|
|
||||||
#.apidoc title: Exported Service methods
|
#.apidoc title: Exported Service methods
|
||||||
#.apidoc module-mods: member-order: bysource
|
#.apidoc module-mods: member-order: bysource
|
||||||
|
|
|
@ -32,9 +32,6 @@
|
||||||
usable in other projects, too.
|
usable in other projects, too.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import socket
|
|
||||||
import base64
|
|
||||||
import errno
|
|
||||||
import SocketServer
|
import SocketServer
|
||||||
from BaseHTTPServer import *
|
from BaseHTTPServer import *
|
||||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||||
|
|
|
@ -37,8 +37,7 @@ __all__ = ['db_connect', 'close_db']
|
||||||
|
|
||||||
from threading import currentThread
|
from threading import currentThread
|
||||||
import logging
|
import logging
|
||||||
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_SERIALIZABLE,\
|
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_REPEATABLE_READ
|
||||||
ISOLATION_LEVEL_REPEATABLE_READ
|
|
||||||
from psycopg2.psycopg1 import cursor as psycopg1cursor
|
from psycopg2.psycopg1 import cursor as psycopg1cursor
|
||||||
from psycopg2.pool import PoolError
|
from psycopg2.pool import PoolError
|
||||||
|
|
||||||
|
@ -421,7 +420,7 @@ class ConnectionPool(object):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
|
result = psycopg2.connect(dsn=dsn, connection_factory=PsycoConnection)
|
||||||
except psycopg2.Error, e:
|
except psycopg2.Error:
|
||||||
self.__logger.exception('Connection to the database failed')
|
self.__logger.exception('Connection to the database failed')
|
||||||
raise
|
raise
|
||||||
self._connections.append((result, True))
|
self._connections.append((result, True))
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import unittest2
|
|
||||||
import xmlrpclib
|
import xmlrpclib
|
||||||
|
|
||||||
import openerp
|
import openerp
|
||||||
|
|
|
@ -7,11 +7,8 @@
|
||||||
# > OPENERP_ADDONS_PATH='../../../addons/trunk' OPENERP_PORT=8069 \
|
# > OPENERP_ADDONS_PATH='../../../addons/trunk' OPENERP_PORT=8069 \
|
||||||
# OPENERP_DATABASE=yy PYTHONPATH=../:. unit2 test_ir_sequence
|
# OPENERP_DATABASE=yy PYTHONPATH=../:. unit2 test_ir_sequence
|
||||||
# This assume an existing database.
|
# This assume an existing database.
|
||||||
import os
|
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import time
|
|
||||||
import unittest2
|
import unittest2
|
||||||
import xmlrpclib
|
|
||||||
|
|
||||||
import openerp
|
import openerp
|
||||||
import common
|
import common
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
# OPENERP_DATABASE=yy nosetests tests/test_xmlrpc.py
|
# OPENERP_DATABASE=yy nosetests tests/test_xmlrpc.py
|
||||||
# > OPENERP_ADDONS_PATH='../../../addons/trunk' OPENERP_PORT=8069 \
|
# > OPENERP_ADDONS_PATH='../../../addons/trunk' OPENERP_PORT=8069 \
|
||||||
# OPENERP_DATABASE=yy PYTHONPATH=../:. unit2 test_xmlrpc
|
# OPENERP_DATABASE=yy PYTHONPATH=../:. unit2 test_xmlrpc
|
||||||
import os
|
|
||||||
import time
|
import time
|
||||||
import unittest2
|
import unittest2
|
||||||
import xmlrpclib
|
import xmlrpclib
|
||||||
|
|
Loading…
Reference in New Issue