Changeset 44 for pkipplib/trunk/bin

Show
Ignore:
Timestamp:
12/11/07 18:16:27 (16 years ago)
Author:
jerome
Message:

Adds the requesting-user-name operation attribute if authentication
is needed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkipplib/trunk/bin/pksubscribe

    r40 r44  
    136136                    sys.stderr.write("%s\n" % answer.operation["status-message"][0][1]) 
    137137                else :     
    138                     print "Subscription %i registered." % subscriptionid 
     138                    print _("Subscription %i registered.") % subscriptionid 
    139139            else :         
    140140                for subid in [int(arg) for arg in arguments] : 
    141141                    answer = cups.cancelSubscription(url, subid, options.job) 
    142                     try : 
    143                         error = answer.operation["status-message"][0][1] 
    144                     except KeyError :     
    145                         print "Subscription %i cancelled." % subid 
    146                     else : 
    147                         sys.stderr.write("%s\n" % error) 
     142                    if answer : 
     143                        try : 
     144                            error = answer.operation["status-message"][0][1] 
     145                        except KeyError :     
     146                            print _("Subscription %i cancelled.") % subid 
     147                        else : 
     148                            sys.stderr.write("%s\n" % error) 
     149                    else :         
     150                        sys.stderr.write(_("Incorrect answer (None)\n")) 
    148151