fix raise string deprecated in python 2.5
bzr revid: ced-ba57e04979dcd47a40b22b2b586489996b06a3d9
This commit is contained in:
parent
1cee6d32cf
commit
5c3609a570
|
@ -262,7 +262,7 @@ class module(osv.osv):
|
|||
|
||||
def state_change(self, cr, uid, ids, newstate, context={}, level=50):
|
||||
if level<1:
|
||||
raise 'Recursion error in modules dependencies !'
|
||||
raise Exception, 'Recursion error in modules dependencies !'
|
||||
demo = True
|
||||
for module in self.browse(cr, uid, ids):
|
||||
mdemo = True
|
||||
|
@ -280,7 +280,7 @@ class module(osv.osv):
|
|||
def state_upgrade(self, cr, uid, ids, newstate, context=None, level=50):
|
||||
dep_obj = self.pool.get('ir.module.module.dependency')
|
||||
if level<1:
|
||||
raise 'Recursion error in modules dependencies !'
|
||||
raise Exception, 'Recursion error in modules dependencies !'
|
||||
for module in self.browse(cr, uid, ids):
|
||||
dep_ids = dep_obj.search(cr, uid, [('name', '=', module.name)])
|
||||
if dep_ids:
|
||||
|
|
|
@ -4,7 +4,7 @@ import os
|
|||
import sys
|
||||
|
||||
if not len(sys.argv)>1:
|
||||
raise 'Usage: gen_graph.sh module1 module2 module3'
|
||||
raise Exception, 'Usage: gen_graph.sh module1 module2 module3'
|
||||
|
||||
modules = sys.argv[1:]
|
||||
done = []
|
||||
|
|
|
@ -94,7 +94,7 @@ class _column(object):
|
|||
cr.execute('update '+obj._table+' set '+name+'='+self._symbol_set[0]+' where id=%d', (self._symbol_set[1](value),id) )
|
||||
|
||||
def get(self, cr, obj, ids, name, context=None, values=None):
|
||||
raise 'undefined get method !'
|
||||
raise Exception, 'undefined get method !'
|
||||
|
||||
def search(self, cr, obj, args, name, value, offset=0, limit=None, uid=None):
|
||||
ids = obj.search(cr, uid, args+self._domain+[(name,'ilike',value)], offset, limit)
|
||||
|
@ -219,7 +219,7 @@ class selection(_column):
|
|||
# la raison est que selection n'est pas en classic_write = false
|
||||
# a noter qu'on pourrait fournir un _symbol_set specifique, et ca suffirait
|
||||
if value in self.selection:
|
||||
raise 'BAD VALUE'
|
||||
raise Exception, 'BAD VALUE'
|
||||
_column.set(self, cr, obj, id, name, value, user=None, context=context)
|
||||
|
||||
|
||||
|
|
|
@ -603,7 +603,7 @@ class orm(object):
|
|||
#
|
||||
for i in range(len(fields)):
|
||||
if i>=len(line):
|
||||
raise 'Please check that all your lines have %d cols.' % (len(fields),)
|
||||
raise Exception, 'Please check that all your lines have %d cols.' % (len(fields),)
|
||||
field = fields[i]
|
||||
if field == ["id"]:
|
||||
data_id= line[i]
|
||||
|
|
|
@ -57,7 +57,7 @@ class report_int(netsvc.Service):
|
|||
assert not netsvc.service_exist(name), 'The report "%s" already exist!'%name
|
||||
super(report_int, self).__init__(name, audience)
|
||||
if name[0:7]<>'report.':
|
||||
raise 'ConceptionError, bad report name, should start with "report."'
|
||||
raise Exception, 'ConceptionError, bad report name, should start with "report."'
|
||||
self.name = name
|
||||
self.id = 0
|
||||
self.name2 = '.'.join(name.split('.')[1:])
|
||||
|
|
|
@ -117,8 +117,8 @@ class db(netsvc.Service):
|
|||
create_thread.start()
|
||||
self.actions[id]['thread'] = create_thread
|
||||
return id
|
||||
raise "Couldn't create database"
|
||||
|
||||
raise Exception, "Couldn't create database"
|
||||
|
||||
def get_progress(self, password, id):
|
||||
security.check_super(password)
|
||||
if self.actions[id]['thread'].isAlive():
|
||||
|
@ -131,10 +131,9 @@ class db(netsvc.Service):
|
|||
del self.actions[id]
|
||||
return (1.0, users)
|
||||
else:
|
||||
print self.actions[id]['traceback']
|
||||
e = self.actions[id]['exception']
|
||||
del self.actions[id]
|
||||
raise e
|
||||
raise Exception, e
|
||||
|
||||
def drop(self, password, db_name):
|
||||
security.check_super(password)
|
||||
|
@ -146,7 +145,7 @@ class db(netsvc.Service):
|
|||
logger = netsvc.Logger()
|
||||
if res:
|
||||
logger.notifyChannel("web-service", netsvc.LOG_ERROR, 'DROP DB: %s failed' % (db_name,))
|
||||
raise "Couldn't drop database"
|
||||
raise Exception, "Couldn't drop database"
|
||||
else:
|
||||
logger.notifyChannel("web-services", netsvc.LOG_INFO, 'DROP DB: %s' % (db_name))
|
||||
return True
|
||||
|
@ -164,7 +163,7 @@ class db(netsvc.Service):
|
|||
logger = netsvc.Logger()
|
||||
if res:
|
||||
logger.notifyChannel("web-service", netsvc.LOG_ERROR, 'DUMP DB: %s failed\n%s' % (db_name, data))
|
||||
raise "Couldn't dump database"
|
||||
raise Exception, "Couldn't dump database"
|
||||
logger.notifyChannel("web-services", netsvc.LOG_INFO, 'DUMP DB: %s' % (db_name))
|
||||
return base64.encodestring(data)
|
||||
|
||||
|
@ -172,7 +171,7 @@ class db(netsvc.Service):
|
|||
security.check_super(password)
|
||||
res = True
|
||||
if self.db_exist(db_name):
|
||||
raise "Database already exists"
|
||||
raise Exception, "Database already exists"
|
||||
else:
|
||||
if tools.config['db_user']:
|
||||
args = ('createdb', '--quiet', '--encoding=unicode', '--username='+tools.config['db_user'], db_name)
|
||||
|
@ -196,11 +195,11 @@ class db(netsvc.Service):
|
|||
stdin.close()
|
||||
res = stdout.close()
|
||||
if res:
|
||||
raise "Couldn't restore database"
|
||||
raise Exception, "Couldn't restore database"
|
||||
logger = netsvc.Logger()
|
||||
logger.notifyChannel("web-services", netsvc.LOG_INFO, 'RESTORE DB: %s' % (db_name))
|
||||
return True
|
||||
raise "Couldn't create database"
|
||||
raise Exception, "Couldn't create database"
|
||||
|
||||
def db_exist(self, db_name):
|
||||
try:
|
||||
|
@ -385,9 +384,9 @@ class wizard(netsvc.Service):
|
|||
if self.wiz_uid[wiz_id] == uid:
|
||||
return self._execute(db, uid, wiz_id, datas, action, context)
|
||||
else:
|
||||
raise 'AccessDenied'
|
||||
raise Exception, 'AccessDenied'
|
||||
else:
|
||||
raise 'WizardNotFound'
|
||||
raise Exception, 'WizardNotFound'
|
||||
wizard()
|
||||
|
||||
#
|
||||
|
@ -460,9 +459,9 @@ class report_spool(netsvc.Service):
|
|||
if self._reports[report_id]['uid'] == uid:
|
||||
return self._check_report(report_id)
|
||||
else:
|
||||
raise 'AccessDenied'
|
||||
raise Exception, 'AccessDenied'
|
||||
else:
|
||||
raise 'ReportNotFound'
|
||||
raise Exception, 'ReportNotFound'
|
||||
|
||||
report_spool()
|
||||
|
||||
|
|
Loading…
Reference in New Issue