Pierre Lambion
12-15-2000, 03:26 AM
I am in no way a programmer so excuse me for this (I guess) basic question.
In Linux I was using "brag" to grap binaries from newsgroups. I wanted similar function in Beos so I wrote a small python script using the nntp and uu modules.
I don't have the code on this (at work) pc but I don't think it matters.
The idea is:
for the specified newsgroups:
get newsgroup info
for every article id :
get article body
write it to an external tmp
decode(tmp)
It was working great except when the article had no binary: uu then gives out an error and the whole process is interrupted. Python ends up with error messages.
To avoid this, the quick workaround was to call an external decde program. It's working OK but it is not the *right* way and it is not portable.
My question is: how do I avoid that an error on a part of my script makes it exit completely. I want uu to try to decode and if it fails, just do it silently and go to the next article. A simple check on the article content wouldn't be sufficient as I'm not handling multi-part attachments and therefore I would still get errors.
Should I set the decode part in a function or what?
Thx in adavnce,
Pierre
In Linux I was using "brag" to grap binaries from newsgroups. I wanted similar function in Beos so I wrote a small python script using the nntp and uu modules.
I don't have the code on this (at work) pc but I don't think it matters.
The idea is:
for the specified newsgroups:
get newsgroup info
for every article id :
get article body
write it to an external tmp
decode(tmp)
It was working great except when the article had no binary: uu then gives out an error and the whole process is interrupted. Python ends up with error messages.
To avoid this, the quick workaround was to call an external decde program. It's working OK but it is not the *right* way and it is not portable.
My question is: how do I avoid that an error on a part of my script makes it exit completely. I want uu to try to decode and if it fails, just do it silently and go to the next article. A simple check on the article content wouldn't be sufficient as I'm not handling multi-part attachments and therefore I would still get errors.
Should I set the decode part in a function or what?
Thx in adavnce,
Pierre