httpauth.py

来自「属性sosuo算法」· Python 代码 · 共 27 行

PY
27
字号
import itertoolsfrom dl_daemon import commandimport eventlooprequestIdGenerator = itertools.count()waitingHTTPAuthCallbacks = {}def handleHTTPAuthResponse(id, authHeader):    callback = waitingHTTPAuthCallbacks.pop(id)    callback(authHeader)def findHTTPAuth(callback, host, path):    id = requestIdGenerator.next()    waitingHTTPAuthCallbacks[id] = callback    from dl_daemon import daemon    c = command.FindHTTPAuthCommand(daemon.lastDaemon, id, host, path)    c.send()def askForHTTPAuth(callback, host, path, authScheme):    id = requestIdGenerator.next()    waitingHTTPAuthCallbacks[id] = callback    from dl_daemon import daemon    c = command.AskForHTTPAuthCommand(daemon.lastDaemon, id, host, path,            authScheme)    c.send()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?