Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary. Loading cookies from a dictionary 'd' is equivalent to calling: map(Cookie.__setitem__, d.keys(), d.values())
(self, rawdata)
| 544 | return _nulljoin(result) |
| 545 | |
| 546 | def load(self, rawdata): |
| 547 | """Load cookies from a string (presumably HTTP_COOKIE) or |
| 548 | from a dictionary. Loading cookies from a dictionary 'd' |
| 549 | is equivalent to calling: |
| 550 | map(Cookie.__setitem__, d.keys(), d.values()) |
| 551 | """ |
| 552 | if isinstance(rawdata, str): |
| 553 | self.__parse_string(rawdata) |
| 554 | else: |
| 555 | # self.update() wouldn't call our custom __setitem__ |
| 556 | for key, value in rawdata.items(): |
| 557 | self[key] = value |
| 558 | return |
| 559 | |
| 560 | def __parse_string(self, str, patt=_CookiePattern): |
| 561 | i = 0 # Our starting point |