Changed exception Amara 1 to 2, maybe add a section to Whatsnew?

7 views
Skip to first unread message

Werner

unread,
May 6, 2012, 8:08:08 AM5/6/12
to ak...@googlegroups.com
With Amara 1 I had:

try:
self.xmlDoc = binderytools.bind_file(file)
except binderytools.xml.sax.SAXParseException, e:
errDict = { 'msg': e.getMessage(),
'line': e.getLineNumber(),
'column': e.getColumnNumber()}

Took me a moment to find the equivalent for Amara 2:
try:
doc = bindery.parse(open(filepath, "r"))
except bindery.Error, e:
errDict = {"errMsg": e.message,
"errLine": e.lineNumber,
"errColumn": e.columnNumber}

Maybe add a para or section to the page: http://xml3k.org/Amara/Whatsnew
on changes in relation to exceptions.

Werner

Luis Miguel Morillas

unread,
May 6, 2012, 10:24:40 AM5/6/12
to ak...@googlegroups.com
2012/5/6 Werner <werner...@sfr.fr>:

Hi, Werner

> With Amara 1 I had:
>
>        try:
>            self.xmlDoc = binderytools.bind_file(file)
>        except binderytools.xml.sax.SAXParseException, e:
>             errDict = { 'msg': e.getMessage(),
>                                'line': e.getLineNumber(),
>                                'column': e.getColumnNumber()}
>
> Took me a moment to find the equivalent for Amara 2:
>    try:
>        doc = bindery.parse(open(filepath, "r"))

You don't need to open the file. Amara can parse the path straight now:

 doc = bindery.parse(filepath)

>    except bindery.Error, e:
>        errDict = {"errMsg": e.message,
>                         "errLine": e.lineNumber,
>                         "errColumn": e.columnNumber}
>
> Maybe add a para or section to the page: http://xml3k.org/Amara/Whatsnew on
> changes in relation to exceptions.
>

Do you want to update the page yourself? Create an user at
http://wiki.xml3k.org/ , tell me the user and I'll add to Editors
Group.

Regards,

-- luismiguel

> Werner
>
> --
> You received this message because you are subscribed to the Google Groups
> "akara" group.
> To post to this group, send email to ak...@googlegroups.com.
> To unsubscribe from this group, send email to
> akara+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/akara?hl=en.
>
Reply all
Reply to author
Forward
0 new messages