Changeset 44
- Timestamp:
- 12/11/07 18:16:27 (17 years ago)
- Location:
- pkipplib/trunk
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pkipplib/trunk/bin/pksubscribe
r40 r44 136 136 sys.stderr.write("%s\n" % answer.operation["status-message"][0][1]) 137 137 else : 138 print "Subscription %i registered."% subscriptionid138 print _("Subscription %i registered.") % subscriptionid 139 139 else : 140 140 for subid in [int(arg) for arg in arguments] : 141 141 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")) 148 151 -
pkipplib/trunk/pkipplib/pkipplib.py
r43 r44 583 583 class CUPS : 584 584 """A class for a CUPS instance.""" 585 def __init__(self, url=None, username=None, password=None, charset="utf-8", language="en- us", debug=False) :585 def __init__(self, url=None, username=None, password=None, charset="utf-8", language="en-US", debug=False) : 586 586 """Initializes the CUPS instance.""" 587 587 if url is not None : … … 638 638 req.operation["attributes-charset"] = ("charset", self.charset) 639 639 req.operation["attributes-natural-language"] = ("naturalLanguage", self.language) 640 if self.username : 641 req.operation["requesting-user-name"] = ("nameWithoutLanguage", self.username) 640 642 return req 641 643 … … 790 792 req.subscription["notify-pull-method"] = ("keyword", pullmethod) 791 793 if charset is not None : 792 req.subscription["notify-charset"] = ("charset", charset )794 req.subscription["notify-charset"] = ("charset", charset or self.charset) 793 795 if naturallanguage is not None : 794 req.subscription["notify-natural-language"] = ("naturalLanguage", naturallanguage )796 req.subscription["notify-natural-language"] = ("naturalLanguage", naturallanguage or self.language) 795 797 if leaseduration is not None : 796 798 req.subscription["notify-lease-duration"] = ("integer", leaseduration)