# -*- coding: utf-8 -*-
##############################################################################
#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-# trml2pdf - An RML to PDF converter
# Copyright (C) 2003, Fabien Pinckaers, UCL, FSA
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+##############################################################################
import copy
import locale
from openerp.tools.safe_eval import safe_eval as eval
from openerp.tools.misc import ustr
+_logger = logging.getLogger(__name__)
+
_regex = re.compile('\[\[(.+?)\]\]')
def str2xml(s):
except GeneratorExit:
continue
except Exception, e:
- logging.getLogger('report').warning('rml_except: "%s"',n.get('rml_except',''), exc_info=True)
+ _logger.warning('rml_except: "%s"', n.get('rml_except',''), exc_info=True)
continue
if n.get('rml_tag'):
try:
except GeneratorExit:
yield n
except Exception, e:
- logging.getLogger('report').warning('rml_tag: "%s"',n.get('rml_tag',''), exc_info=True)
+ _logger.warning('rml_tag: "%s"', n.get('rml_tag',''), exc_info=True)
yield n
else:
yield n
except GeneratorExit:
continue
except Exception, e:
- logging.getLogger('report').warning('rml_except: "%s"',n.get('rml_except',''), exc_info=True)
+ _logger.warning('rml_except: "%s"', n.get('rml_except',''), exc_info=True)
continue
if self and self.localcontext and n.get('rml_tag'):
try:
n2.tag = tag
n2.attrib.update(attr or {})
yield n2
- tagname = ''
+ continue
except GeneratorExit:
pass
except Exception, e:
- logging.getLogger('report').warning('rml_tag: "%s"',n.get('rml_tag',''), exc_info=True)
+ _logger.warning('rml_tag: "%s"', n.get('rml_tag',''), exc_info=True)
pass
if (tagname is None) or (n.tag==tagname):
yield n
def bool_get(value):
return (str(value)=="1") or (value.lower()=='yes')
-def attr_get(node, attrs, dict={}):
+def attr_get(node, attrs, dict=None):
+ if dict is None:
+ dict = {}
res = {}
for name in attrs:
if node.get(name):