def test_list(self):
        textdoc = OpenDocumentText()

        s = textdoc.styles
        listStyle = easyliststyle.styleFromString(u'bullet1', bulletListSpec,
                                                  u',', u'0.6cm',
                                                  easyliststyle.SHOW_ONE_LEVEL)
        s.addElement(listStyle)
        result = textdoc.stylesxml()
        self.assertNotEqual(-1, result.find(u'''style:name="bullet1"'''))
        self.assertNotEqual(-1, result.find(u'''text:bullet-char="*"'''))
        self.assertNotEqual(-1, result.find(u'''text:level="1"'''))
        self.assertNotEqual(-1,
                            result.find(u'''style:list-level-properties'''))
        #<text:list-style style:name="bullet1" style:display-name="bullet1">
        #<text:list-level-style-bullet text:bullet-char="*" text:level="1">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="0.6cm"/>
        #</text:list-level-style-bullet>
        #<text:list-level-style-bullet text:bullet-char="&gt;" text:level="2">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="1.2cm"/>
        #</text:list-level-style-bullet>
        #<text:list-level-style-bullet text:bullet-char="#" text:level="3">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="1.8cm"/>
        #</text:list-level-style-bullet>
        #<text:list-level-style-bullet text:bullet-char="%" text:level="4">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="2.4cm"/>

        listElement = self.createList(itemList, u'>', u'bullet1')
        textdoc.text.addElement(listElement)

        para = P(text="-----------------------")
        textdoc.text.addElement(para)

        listStyle = easyliststyle.styleFromList('num1', numberListSpecArray,
                                                '0.25in',
                                                easyliststyle.SHOW_ALL_LEVELS)
        s.addElement(listStyle)

        listElement = self.createList(itemList, '>', 'num1')
        textdoc.text.addElement(listElement)

        para = P(text="-----------------------")
        textdoc.text.addElement(para)

        listStyle = easyliststyle.styleFromString('mix1', mixedListSpec, '!',
                                                  '0.8cm',
                                                  easyliststyle.SHOW_ONE_LEVEL)
        s.addElement(listStyle)

        listElement = self.createList(itemList, '>', 'mix1')
        textdoc.text.addElement(listElement)
Esempio n. 2
0
    def test_list(self):
        textdoc = OpenDocumentText()

        s = textdoc.styles
        listStyle = easyliststyle.styleFromString(u'bullet1', bulletListSpec,
            u',', u'0.6cm', easyliststyle.SHOW_ONE_LEVEL)
        s.addElement(listStyle)
        result = textdoc.stylesxml()
        self.assertNotEqual(-1, result.find(u'''style:name="bullet1"'''))
        self.assertNotEqual(-1, result.find(u'''text:bullet-char="*"'''))
        self.assertNotEqual(-1, result.find(u'''text:level="1"'''))
        self.assertNotEqual(-1, result.find(u'''style:list-level-properties'''))
        #<text:list-style style:name="bullet1" style:display-name="bullet1">
        #<text:list-level-style-bullet text:bullet-char="*" text:level="1">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="0.6cm"/>
        #</text:list-level-style-bullet>
        #<text:list-level-style-bullet text:bullet-char="&gt;" text:level="2">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="1.2cm"/>
        #</text:list-level-style-bullet>
        #<text:list-level-style-bullet text:bullet-char="#" text:level="3">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="1.8cm"/>
        #</text:list-level-style-bullet>
        #<text:list-level-style-bullet text:bullet-char="%" text:level="4">
        #<style:list-level-properties text:min-label-width="0.6cm" text:space-before="2.4cm"/>

        listElement = self.createList(itemList, u'>', u'bullet1')
        textdoc.text.addElement(listElement)

        para = P(text="-----------------------");
        textdoc.text.addElement(para)

        listStyle = easyliststyle.styleFromList('num1', numberListSpecArray,
            '0.25in', easyliststyle.SHOW_ALL_LEVELS)
        s.addElement(listStyle)

        listElement = self.createList(itemList, '>', 'num1')
        textdoc.text.addElement(listElement)

        para = P(text="-----------------------");
        textdoc.text.addElement(para)

        listStyle = easyliststyle.styleFromString('mix1', mixedListSpec,
            '!', '0.8cm', easyliststyle.SHOW_ONE_LEVEL)
        s.addElement(listStyle)

        listElement = self.createList(itemList, '>', 'mix1')
        textdoc.text.addElement(listElement)
Esempio n. 3
0
    def write_export_node_to_file(odt_file, item_list):
        """
        Exporting process to ODT file.
        :param odt_file: ODT file pathname,
        :param item_list: array of strings with document list items.
        """
        mixed_list_spec = '1.,1.,1.,1.,1.,1.'

        textdoc = OpenDocumentText()

        s = textdoc.styles

        list_style = easyliststyle.styleFromString(
            "mix", mixed_list_spec, ",", "0.8cm", easyliststyle.SHOW_ONE_LEVEL)
        s.addElement(list_style)

        list_element = BpmnDiagramGraphOdtExport.create_list(
            item_list, ">", "mix")
        textdoc.text.addElement(list_element)

        textdoc.save(odt_file)
Esempio n. 4
0
        listArray[level].setAttribute( 'stylename', styleName );
        listItem = ListItem()
        para = P(text=item);
        listItem.addElement(para);
        listArray[level].addElement(listItem);
        lastLevel = level;

    # close off any remaining open lists
    for levCount in range(lastLevel, 0, -1):
        listArray[levCount-1].childNodes[-1].addElement(listArray[levCount])
    return listArray[0]

textdoc = OpenDocumentText()

s = textdoc.styles
listStyle = easyliststyle.styleFromString('bullet1', bulletListSpec,
    ',', '0.6cm', easyliststyle.SHOW_ONE_LEVEL)
s.addElement(listStyle)

listElement = createList(itemList, '>', 'bullet1')
textdoc.text.addElement(listElement)

para = P(text="-----------------------");
textdoc.text.addElement(para)

listStyle = easyliststyle.styleFromList('num1', numberListSpecArray,
    '0.25in', easyliststyle.SHOW_ALL_LEVELS)
s.addElement(listStyle)

listElement = createList(itemList, '>', 'num1')
textdoc.text.addElement(listElement)
Esempio n. 5
0
        para = P(text=item)
        listItem.addElement(para)
        listArray[level].addElement(listItem)
        lastLevel = level

    # close off any remaining open lists
    for levCount in range(lastLevel, 0, -1):
        listArray[levCount - 1].childNodes[-1].addElement(listArray[levCount])
    return listArray[0]


textdoc = OpenDocumentText()

s = textdoc.styles
listStyle = easyliststyle.styleFromString('bullet1', bulletListSpec, ',',
                                          '0.6cm',
                                          easyliststyle.SHOW_ONE_LEVEL)
s.addElement(listStyle)

listElement = createList(itemList, '>', 'bullet1')
textdoc.text.addElement(listElement)

para = P(text="-----------------------")
textdoc.text.addElement(para)

listStyle = easyliststyle.styleFromList('num1', numberListSpecArray, '0.25in',
                                        easyliststyle.SHOW_ALL_LEVELS)
s.addElement(listStyle)

listElement = createList(itemList, '>', 'num1')
textdoc.text.addElement(listElement)