Skip to content
Myr

Cleanups

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Kenneth Reitz · committed by Kenneth Reitz · parent d91157c · Browse files · 1 file+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−0 removed

  • other:+11 added−0 removed

1 file+11 added−0 removed

modified:requests/core.py+11 added
78 unmodified lines
79 self.auth = auth80 self.cookiejar = cookiejar81 self.sent = False828384 def __repr__(self):85 return '<Request [%s]>' % (self.method)8687 def __setattr__(self, name, value):
117 unmodified lines
205206207208class AuthManager(object):209 """Authentication Manager."""210 211 def __new__(cls):212 singleton = cls.__dict__.get('__singleton__')213 if singleton is not None:214 return singleton
4 unmodified lines
219220 def __init__(self):221 self.passwd = {}222 self._auth = {}223 224 def __repr__(self):225 return '<AuthManager [%s]>' % (self.method)226227 def add_auth(self, uri, auth):228 """Registers AuthObject to AuthManager."""229 230 uri = self.reduce_uri(uri, False)231 self._auth[uri] = auth232233 def add_password(self, realm, uri, user, passwd):234 """Adds password to AuthManager."""235 # uri could be a single URI or a sequence236 if isinstance(uri, basestring):237 uri = [uri]238 239 reduced_uri = tuple([self.reduce_uri(u, False) for u in uri])240 241 if reduced_uri not in self.passwd:242 self.passwd[reduced_uri] = {}243 self.passwd[reduced_uri] = (user, passwd)244
209 unmodified lines