On 12/15/11 10:57 AM, Ed Leafe wrote:
> +                             if ord(val[0])>  127:
> +                                     # Only ASCII chars allowed
> +                                     dabo.log.error(_("GroupChar must be a 
> valid ASCII character; "
> +                                                     "'%s' is not allowed.") 
> % val)
> +                                     return
> +                             if len(val)>  1:
> +                                     dabo.log.error(_("GroupChar must be a 
> single character; "
> +                                                     "attempted to set it to 
> a string of length %s.") % len(val))
> +                                     return

I wonder if this should be:

   if ord(val[0] > 127):
     raise ValueError("GroupChar must be a valid ASCII char...")
   if len(val > 1):
     raise ValueError("GroupChar must be a single char...")

because it is more useful when developing to be interrupted with a stack trace, 
than 
to have to look in the error log and wonder where in the code the error 
occurred. Or 
worse, not even realizing there was a problem.

Paul

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: http://leafe.com/archives/byMID/[email protected]

Reply via email to