Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
news
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sartika Aritonang
news
Commits
2dbcfe3f
Commit
2dbcfe3f
authored
May 29, 2020
by
Sartika Aritonang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
c565f3bc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
hooks.py
stbi/Lib/site-packages/pip/_vendor/requests/hooks.py
+34
-0
No files found.
stbi/Lib/site-packages/pip/_vendor/requests/hooks.py
0 → 100644
View file @
2dbcfe3f
# -*- coding: utf-8 -*-
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS
=
[
'response'
]
def
default_hooks
():
return
{
event
:
[]
for
event
in
HOOKS
}
# TODO: response is the only one
def
dispatch_hook
(
key
,
hooks
,
hook_data
,
**
kwargs
):
"""Dispatches a hook dictionary on a given piece of data."""
hooks
=
hooks
or
{}
hooks
=
hooks
.
get
(
key
)
if
hooks
:
if
hasattr
(
hooks
,
'__call__'
):
hooks
=
[
hooks
]
for
hook
in
hooks
:
_hook_data
=
hook
(
hook_data
,
**
kwargs
)
if
_hook_data
is
not
None
:
hook_data
=
_hook_data
return
hook_data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment