def get_cookie_rewriter(self, scope=None): # collection scope overrides rule scope? if self.cookie_scope: scope = self.cookie_scope cls = get_cookie_rewriter(scope) return cls(self)
def rewrite_cookie(cookie_str, rewriter=urlrewriter, scope='default'): cookie_rewriter = get_cookie_rewriter(scope) return cookie_rewriter(rewriter).rewrite(cookie_str)