[WIP] start the implementation of WarningConfig

bzr revid: abo@openerp.com-20130118171619-dx0yjwuun0j7m43p
This commit is contained in:
Antonin Bourguignon 2013-01-18 18:16:19 +01:00
parent 6f5c0e1a08
commit 64eedb6816
1 changed files with 14 additions and 1 deletions

View File

@ -35,7 +35,20 @@ class Warning(Exception):
class WarningConfig(Exception):
""" Warning bound to a misconfiguration. """
def __init__(self, msg):
# todo: treat the msg (regex)
# WIP WIP WIP WIP WIP WIP WIP
def sub_path(g):
menu_xml_id = g.group(1)
return '(group to convert: '+menu_xml_id+')'
def sub_path(g):
menu_xml_id = g.group(1)
return '(group to convert: '+menu_xml_id+')'
# Treat the msg: find the menu_xml_id and the field_name
teststr = 'coucou [path:blabla_bla_bla]'
print ">>>>> sub: ", re.sub(r'\[path:([a-z_]*)\]', sub_path, teststr)
super(WarningConfig, self).__init__(msg)
class AccessDenied(Exception):