Did I find the right examples for you? yes no

All Samples(144)  |  Call(144)  |  Derive(0)  |  Import(0)

        def unit_get(size):
    global units
    if size:
        if size.find('.') == -1:
            decimal_point = '.'
            try:
                decimal_point = locale.nl_langinfo(locale.RADIXCHAR)
            except Exception:
                decimal_point = locale.localeconv()['decimal_point']

            size = size.replace(decimal_point, '.')

        for unit in units:
            res = unit[0].search(size, 0)
            if res:
                return unit[1]*float(res.group(1))
    return False
        


src/o/p/openerp-core-7.0.406/openerp/report/render/rml2pdf/trml2pdf.py   openerp-core(Download)
    def draw(self):
        self.canv.beginForm("pageCount%d" % self.story_count)
        self.canv.setFont("Helvetica", utils.unit_get(str(8)))
        self.canv.drawString(0, 0, str(self.canv.getPageNumber()))
        self.canv.endForm()
            'borderWidth','borderPadding','borderRadius']:
            if node.get(attr):
                data[attr] = utils.unit_get(node.get(attr))
        if node.get('alignment'):
            align = {
                styles.append(('TEXTCOLOR', start, stop, color.get(str(node.get('colorName')))))
            elif node.tag=='blockLeading':
                styles.append(('LEADING', start, stop, utils.unit_get(node.get('length'))))
            elif node.tag=='blockAlignment':
                styles.append(('ALIGNMENT', start, stop, str(node.get('value'))))
            elif node.tag=='blockSpan':
                styles.append(('SPAN', start, stop))
            elif node.tag=='blockLeftPadding':
                styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.get('length'))))
                styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.get('length'))))
            elif node.tag=='blockRightPadding':
                styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.get('length'))))
            elif node.tag=='blockTopPadding':
                styles.append(('TOPPADDING', start, stop, utils.unit_get(node.get('length'))))

src/o/p/openerp-server-5.0.0-3/bin/report/render/rml2pdf/trml2pdf.py   openerp-server(Download)
    def draw(self):
        self.canv.beginForm("pageCount")
        self.canv.setFont("Helvetica", utils.unit_get(str(8)))
        self.canv.drawString(0, 0, str(self.canv.getPageNumber()))
        self.canv.endForm()
            'borderWidth','borderPadding','borderRadius']:
            if node.hasAttribute(attr):
                data[attr] = utils.unit_get(node.getAttribute(attr))
        if node.hasAttribute('alignment'):
            align = {
                    styles.append(('TEXTCOLOR', start, stop, color.get(str(node.getAttribute('colorName')))))
                elif node.localName=='blockLeading':
                    styles.append(('LEADING', start, stop, utils.unit_get(node.getAttribute('length'))))
                elif node.localName=='blockAlignment':
                    styles.append(('ALIGNMENT', start, stop, str(node.getAttribute('value'))))
                elif node.localName=='blockSpan':
                    styles.append(('SPAN', start, stop))
                elif node.localName=='blockLeftPadding':
                    styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
                    styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
                elif node.localName=='blockRightPadding':
                    styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
                elif node.localName=='blockTopPadding':
                    styles.append(('TOPPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))

src/t/r/trml2pdf-HEAD/trml2pdf/trml2pdf.py   trml2pdf(Download)
		for attr in ['fontSize', 'leftIndent', 'rightIndent', 'spaceBefore', 'spaceAfter', 'firstLineIndent', 'bulletIndent', 'bulletFontSize', 'leading']:
			if node.hasAttribute(attr):
				style.__dict__[attr] = utils.unit_get(node.getAttribute(attr))
		if node.hasAttribute('alignment'):
			align = {
					styles.append(('TEXTCOLOR', start, stop, color.get(str(node.getAttribute('colorName')))))
				elif node.localName=='blockLeading':
					styles.append(('LEADING', start, stop, utils.unit_get(node.getAttribute('length'))))
				elif node.localName=='blockAlignment':
					styles.append(('ALIGNMENT', start, stop, str(node.getAttribute('value'))))
				elif node.localName=='blockLeftPadding':
					styles.append(('LEFTPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
				elif node.localName=='blockRightPadding':
					styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
					styles.append(('RIGHTPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
				elif node.localName=='blockTopPadding':
					styles.append(('TOPPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))
				elif node.localName=='blockBottomPadding':
					styles.append(('BOTTOMPADDING', start, stop, utils.unit_get(node.getAttribute('length'))))

src/o/p/openerp-core-7.0.406/openerp/report/render/rml2txt/rml2txt.py   openerp-core(Download)
    def _tag_spacer(self, node):
        length = 1+int(utils.unit_get(node.get('length')))/35
        return "\n"*length
 
    def _tag_table(self, node):
        sizes = None
        if node.get('colWidths'):
            sizes = map(lambda x: utils.unit_get(x), node.get('colWidths').split(','))
        trs = []
        for n in utils._child_get(node,self):
    def __init__(self, node, style):
        self.posx = utils.unit_get(node.get('x'))
        self.posy =  utils.unit_get(node.get('y'))
        aligns = {
            'drawString': 'left',
    def __init__(self, node, style):
        coord = [utils.unit_get(x) for x in utils.text_get(node).split(' ')]
        self.ok = False
        self.posx = coord[0]
        self.posy = coord[1]

src/o/p/openerp-server-5.0.0-3/bin/report/render/rml2html/rml2html.py   openerp-server(Download)
    def _tag_spacer(self, node):
        length = 1+int(utils.unit_get(node.getAttribute('length')))/35
        return "<br/>"*length
 
    def _tag_table(self, node):
        node.tagName='table'
        if node.hasAttribute('colWidths'):
            sizes = map(lambda x: utils.unit_get(x), node.getAttribute('colWidths').split(','))
    def __init__(self, node, style):
        self.posx = utils.unit_get(node.getAttribute('x'))
        self.posy =  utils.unit_get(node.getAttribute('y'))
        aligns = {
            'drawString': 'left',
    def __init__(self, node, style):
        coord = [utils.unit_get(x) for x in utils.text_get(node).split(' ')]
        self.ok = False
        self.posx = coord[0]
        self.posy = coord[1]