Package: rss2email
Version: 1:2.54-2
Severity: minor
Tags: patch

The error message displayed when you try to add a 2nd feed when no
default address is defined is kinda ugly.  I don't think we should be
throwing Python exceptions at users but well-formed error messages.

Example with the current version:

3820:[EMAIL PROTECTED]: ~] rm -rf .rss2email
3821:[EMAIL PROTECTED]: ~] r2e new
3822:[EMAIL PROTECTED]: ~] r2e add 'http://www.cyrius.com/journal/?flav=atom'
3823:[EMAIL PROTECTED]: ~] r2e add 'http://www.cyrius.com/journal/?flav=atom'
Traceback (most recent call last):
  File "/usr/share/rss2email/rss2email.py", line 489, in ?
    elif action == "add": add(*args)
  File "/usr/share/rss2email/rss2email.py", line 277, in add
    raise 'NoEmail', "Run `email newaddr` or `add url addr`."
NoEmail: Run `email newaddr` or `add url addr`.

Eek!

Example with the patch below:

3824:[EMAIL PROTECTED]: ~] rm -rf .rss2email
3825:[EMAIL PROTECTED]: ~] r2e new
3826:[EMAIL PROTECTED]: ~] r2e add 'doo'
3827:[EMAIL PROTECTED]: ~] r2e add 'doo'
No email address has been defined. Please run 'email newaddr' or
'add url addr'.
zsh: exit 1     r2e add 'doo'


Yes, basically does the same but imho looks much more user-friendly.
And since the NoEmail exception is not caught anyway, I don't see a
point in raising it.


--- rss2email.py~       2005-05-23 21:52:38.728516272 +0100
+++ rss2email.py        2005-05-23 22:13:24.283163184 +0100
@@ -274,7 +274,9 @@
        
        feeds, feedfileObject = load()
        if feeds and not isstr(feeds[0]) and to is None:
-               raise 'NoEmail', "Run `email newaddr` or `add url addr`."
+               print "No email address has been defined. Please run 'email 
newaddr' or"
+               print "'add url addr'."
+               sys.exit(1)
        for url in urls: feeds.append(Feed(url, to))
        unlock(feeds, feedfileObject)
 


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.10-1-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages rss2email depends on:
ii  python                        2.3.5-2    An interactive high-level object-o

-- no debconf information

-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to