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/pkipplib/pkipplib.py

    r43 r44  
    583583class CUPS : 
    584584    """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) : 
    586586        """Initializes the CUPS instance.""" 
    587587        if url is not None : 
     
    638638            req.operation["attributes-charset"] = ("charset", self.charset) 
    639639            req.operation["attributes-natural-language"] = ("naturalLanguage", self.language) 
     640            if self.username : 
     641                req.operation["requesting-user-name"] = ("nameWithoutLanguage", self.username) 
    640642            return req 
    641643     
     
    790792            req.subscription["notify-pull-method"] = ("keyword", pullmethod) 
    791793        if charset is not None : 
    792             req.subscription["notify-charset"] = ("charset", charset) 
     794            req.subscription["notify-charset"] = ("charset", charset or self.charset) 
    793795        if naturallanguage is not None : 
    794             req.subscription["notify-natural-language"] = ("naturalLanguage", naturallanguage) 
     796            req.subscription["notify-natural-language"] = ("naturalLanguage", naturallanguage or self.language) 
    795797        if leaseduration is not None : 
    796798            req.subscription["notify-lease-duration"] = ("integer", leaseduration)