Skip to content

code fails with Debian/Stretch Scribus 1.4.5 #1

@garydale

Description

@garydale

I maintain a directory of Lions Clubs in an XML file (see http://www.a711lions.ca/clubs.xml). I'm now asked to produce a printed district directory showing, among other things, the same information just formatted for print. I am trying to use formatxml-scribus to do that.

My initial attempt was to cut and paste the code I found on the scribus wiki but that didn't work for me. When I located your version on github, I gave it a try with much better results. I got the dialogues that asked for the various files and got one line of text added to the scribus document. This was the name of the first club, which was the first leaf element in the XML file.

At that point the program crashed with the error:
Traceback (most recent call last):
File "", line 8, in
File "/home/garydale/mnt2/webpages/Lions Clubs/A711/formatxml-scribus-master/formatxml.py", line 179, in
main_wrapper()
File "/home/garydale/mnt2/webpages/Lions Clubs/A711/formatxml-scribus-master/formatxml.py", line 165, in main_wrapper
main()
File "/home/garydale/mnt2/webpages/Lions Clubs/A711/formatxml-scribus-master/formatxml.py", line 151, in main
format (xml_file, template, document)
File "/home/garydale/mnt2/webpages/Lions Clubs/A711/formatxml-scribus-master/formatxml.py", line 136, in format
p.parse(xml_file)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 110, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.7/xml/sax/expatreader.py", line 213, in feed
self._parser.Parse(data, isFinal)
File "/home/garydale/mnt2/webpages/Lions Clubs/A711/formatxml-scribus-master/formatxml.py", line 97, in characters
if self.styles[-1] != None and go_ahead:
IndexError: list index out of range

I've never use python myself and have no experience with Scribus scripting. This was my first attempt at using a script and I've never even considered writing one. I've validated my xml file against a couple different online validators and it checks out as OK on both.

Hoping that you can identify the problem and suggest a fix.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions