Windows NT KAMIDAKI 10.0 build 19045 (Windows 10) AMD64
Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.3.9
Server IP : 192.168.3.16 & Your IP : 216.73.216.52
Domains :
Cant Read [ /etc/named.conf ]
User : SISTEMA
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
C: /
Users /
VEGETA /
Envs /
Pessoais /
Lib /
site-packages /
Delete
Unzip
Name
Size
Permission
Date
Action
Django-5.0.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
EasyProcess-1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
Flask-2.2.5.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
Jinja2-3.1.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
MarkupSafe-2.1.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
MouseInfo-0.1.3.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PIL
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
Pillow-9.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
PyAutoGUI-0.9.54.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyGetWindow-0.0.9.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyMsgBox-1.0.9.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyMySQL-1.1.0.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:21
PyRect-0.2.0.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
PyScreeze-0.1.29.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
Werkzeug-2.2.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
__pycache__
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
_distutils_hack
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
_plotly_future_
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
_plotly_utils
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
aiohttp
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
aiohttp-3.9.3.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
aiosignal
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
aiosignal-1.3.1.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
ansi2html
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
ansi2html-1.8.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
asgiref
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
asgiref-3.7.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
attr
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
attrs
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
attrs-23.2.0.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
bcrypt
[ DIR ]
drwxrwxrwx
2024-03-07 15:54
bcrypt-4.1.2.dist-info
[ DIR ]
drwxrwxrwx
2024-03-07 15:54
beautifulsoup4-4.12.2.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
blinker
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
blinker-1.6.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
body
[ DIR ]
drwxrwxrwx
2024-03-12 18:33
body-0.1.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 18:33
bs4
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
certifi
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
certifi-2023.5.7.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
chardet
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
chardet-3.0.4.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
charset_normalizer
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
charset_normalizer-3.1.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
click
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
click-8.1.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
colorama
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
colorama-0.4.6.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
contourpy
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
contourpy-1.1.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
cycler-0.11.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
dash
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
dash-2.11.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
dash_core_components
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_core_components-2.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_html_components
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_html_components-2.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_table
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dash_table-5.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
dateutil
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
discord
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
discord-2.3.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
discord.py-2.3.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
django
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
django_scheduler-0.10.1.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
easyprocess
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
entrypoint2
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
entrypoint2-1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
flask
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
fontTools
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
fonttools-4.40.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
frozenlist
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
frozenlist-1.4.1.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
game
[ DIR ]
drwxrwxrwx
2024-03-11 21:24
game-0.0.5.dist-info
[ DIR ]
drwxrwxrwx
2024-03-11 21:24
google-3.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:29
googlesearch
[ DIR ]
drwxrwxrwx
2023-11-15 23:29
googletrans
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
googletrans-3.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h11
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h11-0.9.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h2
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
h2-3.2.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hpack
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hpack-3.0.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hstspreload
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hstspreload-2023.1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpcore
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpcore-0.9.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpx
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
httpx-0.13.3.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hyperframe
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
hyperframe-5.2.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
icalendar
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
icalendar-5.0.11.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
icon
[ DIR ]
drwxrwxrwx
2024-03-05 14:04
icon-0.0.5.dist-info
[ DIR ]
drwxrwxrwx
2024-03-05 14:04
idna
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
idna-2.10.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
itsdangerous
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
itsdangerous-2.1.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
jinja2
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
jupyterlab_plotly
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
kiwisolver
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
kiwisolver-1.4.4.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
libretranslatepy
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
libretranslatepy-2.1.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
lxml
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
lxml-4.9.3.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
markupsafe
[ DIR ]
drwxrwxrwx
2023-06-29 03:51
matplotlib
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
matplotlib-3.7.1.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
matplotlib.libs
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
mouseinfo
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
mpl_toolkits
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
mss
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
mss-9.0.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
multidict
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
multidict-6.0.5.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
nest_asyncio-1.5.6.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
numpy
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
numpy-1.25.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
packaging
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
packaging-23.1.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pandas
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
pandas-2.0.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
pexpect
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
pexpect-4.8.0.dist-info
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
pip
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
pip-23.0.1.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
pkg_resources
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
plotly
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
plotly-5.15.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:18
psutil
[ DIR ]
drwxrwxrwx
2023-11-20 14:08
psutil-5.9.6.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 14:08
ptyprocess
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
ptyprocess-0.7.0.dist-info
[ DIR ]
drwxrwxrwx
2023-09-27 19:37
py4j
[ DIR ]
drwxrwxrwx
2023-10-10 16:08
py4j-0.10.9.7.dist-info
[ DIR ]
drwxrwxrwx
2023-10-10 16:08
pyautogui
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyfiglet
[ DIR ]
drwxrwxrwx
2024-02-26 00:55
pyfiglet-1.0.2.dist-info
[ DIR ]
drwxrwxrwx
2024-02-26 00:55
pygame
[ DIR ]
drwxrwxrwx
2023-06-29 04:25
pygame-2.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:25
pygetwindow
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pymsgbox
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pymysql
[ DIR ]
drwxrwxrwx
2024-02-20 18:21
pyparsing
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pyparsing-3.1.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pyperclip
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyperclip-1.8.2.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyrect
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyscreenshot
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyscreenshot-3.1.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyscreeze
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pyspark
[ DIR ]
drwxrwxrwx
2023-10-10 16:09
pyspark-3.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-10-10 16:09
pystray
[ DIR ]
drwxrwxrwx
2024-03-05 14:09
pystray-0.19.5.dist-info
[ DIR ]
drwxrwxrwx
2024-03-05 14:09
python_dateutil-2.8.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
pytweening
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pytweening-1.0.7.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 16:50
pytz
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
pytz-2023.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
requests
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
requests-2.31.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
retrying-1.3.4.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
rfc3986
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
rfc3986-1.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
scapy
[ DIR ]
drwxrwxrwx
2023-11-20 00:59
scapy-2.5.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 00:59
schedule
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
setuptools
[ DIR ]
drwxrwxrwx
2023-09-21 16:49
setuptools-67.6.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
six-1.16.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:41
sniffio
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
sniffio-1.3.0.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
soupsieve
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
soupsieve-2.5.dist-info
[ DIR ]
drwxrwxrwx
2023-11-14 14:19
sqlparse
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
sqlparse-0.4.4.dist-info
[ DIR ]
drwxrwxrwx
2024-02-25 20:37
startrek
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
startrek-0.4.2.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
tabulate
[ DIR ]
drwxrwxrwx
2024-03-12 19:19
tabulate-0.9.0.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 19:19
tcp
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
tcp-0.4.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
telnetlib3
[ DIR ]
drwxrwxrwx
2023-09-21 15:21
telnetlib3-2.0.4.dist-info
[ DIR ]
drwxrwxrwx
2023-09-21 15:21
tenacity
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
tenacity-8.2.2.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
test
[ DIR ]
drwxrwxrwx
2023-11-20 00:59
tests
[ DIR ]
drwxrwxrwx
2024-02-25 20:38
translate
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
translate-3.6.1.dist-info
[ DIR ]
drwxrwxrwx
2023-11-15 23:30
typing_extensions-4.7.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
tzdata
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
tzdata-2023.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
udp
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
udp-0.5.10.dist-info
[ DIR ]
drwxrwxrwx
2023-11-20 01:28
urllib3
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
urllib3-2.0.3.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
urwid
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
urwid-2.6.8.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
wcwidth
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
wcwidth-0.2.13.dist-info
[ DIR ]
drwxrwxrwx
2024-03-12 18:32
werkzeug
[ DIR ]
drwxrwxrwx
2023-06-29 04:17
wheel
[ DIR ]
drwxrwxrwx
2023-09-21 16:49
wheel-0.40.0.dist-info
[ DIR ]
drwxrwxrwx
2023-06-29 03:40
yarl
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
yarl-1.9.4.dist-info
[ DIR ]
drwxrwxrwx
2024-02-20 18:30
_virtualenv.pth
18
B
-rw-rw-rw-
2023-06-29 03:40
_virtualenv.py
5.63
KB
-rw-rw-rw-
2023-06-29 03:40
cycler.py
14.18
KB
-rw-rw-rw-
2023-06-29 03:41
distutils-precedence.pth
151
B
-rw-rw-rw-
2023-06-29 03:40
matplotlib-3.7.1-py3.11-nspkg.pth
570
B
-rw-rw-rw-
2023-06-29 03:41
nest_asyncio.py
7.6
KB
-rw-rw-rw-
2023-06-29 04:17
pip-23.0.1.virtualenv
0
B
-rw-rw-rw-
2023-06-29 03:40
pylab.py
93
B
-rw-rw-rw-
2023-06-29 03:41
retrying.py
11
KB
-rw-rw-rw-
2023-06-29 04:17
setuptools-67.6.0.virtualenv
0
B
-rw-rw-rw-
2023-06-29 03:40
six.py
33.74
KB
-rw-rw-rw-
2023-06-29 03:41
typing_extensions.py
107.76
KB
-rw-rw-rw-
2023-06-29 04:17
wheel-0.40.0.virtualenv
0
B
-rw-rw-rw-
2023-06-29 03:40
Save
Rename
# Copyright 2013-2014 Ray Holder # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import random import six import sys import time import traceback # sys.maxint / 2, since Python 3.2 doesn't have a sys.maxint... MAX_WAIT = 1073741823 def _retry_if_exception_of_type(retryable_types): def _retry_if_exception_these_types(exception): return isinstance(exception, retryable_types) return _retry_if_exception_these_types def retry(*dargs, **dkw): """ Decorator function that instantiates the Retrying object @param *dargs: positional arguments passed to Retrying object @param **dkw: keyword arguments passed to the Retrying object """ # support both @retry and @retry() as valid syntax if len(dargs) == 1 and callable(dargs[0]): def wrap_simple(f): @six.wraps(f) def wrapped_f(*args, **kw): return Retrying().call(f, *args, **kw) return wrapped_f return wrap_simple(dargs[0]) else: def wrap(f): @six.wraps(f) def wrapped_f(*args, **kw): return Retrying(*dargs, **dkw).call(f, *args, **kw) return wrapped_f return wrap class Retrying(object): def __init__( self, stop=None, wait=None, stop_max_attempt_number=None, stop_max_delay=None, wait_fixed=None, wait_random_min=None, wait_random_max=None, wait_incrementing_start=None, wait_incrementing_increment=None, wait_incrementing_max=None, wait_exponential_multiplier=None, wait_exponential_max=None, retry_on_exception=None, retry_on_result=None, wrap_exception=False, stop_func=None, wait_func=None, wait_jitter_max=None, before_attempts=None, after_attempts=None, ): self._stop_max_attempt_number = ( 5 if stop_max_attempt_number is None else stop_max_attempt_number ) self._stop_max_delay = 100 if stop_max_delay is None else stop_max_delay self._wait_fixed = 1000 if wait_fixed is None else wait_fixed self._wait_random_min = 0 if wait_random_min is None else wait_random_min self._wait_random_max = 1000 if wait_random_max is None else wait_random_max self._wait_incrementing_start = ( 0 if wait_incrementing_start is None else wait_incrementing_start ) self._wait_incrementing_increment = ( 100 if wait_incrementing_increment is None else wait_incrementing_increment ) self._wait_exponential_multiplier = ( 1 if wait_exponential_multiplier is None else wait_exponential_multiplier ) self._wait_exponential_max = ( MAX_WAIT if wait_exponential_max is None else wait_exponential_max ) self._wait_incrementing_max = ( MAX_WAIT if wait_incrementing_max is None else wait_incrementing_max ) self._wait_jitter_max = 0 if wait_jitter_max is None else wait_jitter_max self._before_attempts = before_attempts self._after_attempts = after_attempts # TODO add chaining of stop behaviors # stop behavior stop_funcs = [] if stop_max_attempt_number is not None: stop_funcs.append(self.stop_after_attempt) if stop_max_delay is not None: stop_funcs.append(self.stop_after_delay) if stop_func is not None: self.stop = stop_func elif stop is None: self.stop = lambda attempts, delay: any( f(attempts, delay) for f in stop_funcs ) else: self.stop = getattr(self, stop) # TODO add chaining of wait behaviors # wait behavior wait_funcs = [lambda *args, **kwargs: 0] if wait_fixed is not None: wait_funcs.append(self.fixed_sleep) if wait_random_min is not None or wait_random_max is not None: wait_funcs.append(self.random_sleep) if ( wait_incrementing_start is not None or wait_incrementing_increment is not None ): wait_funcs.append(self.incrementing_sleep) if wait_exponential_multiplier is not None or wait_exponential_max is not None: wait_funcs.append(self.exponential_sleep) if wait_func is not None: self.wait = wait_func elif wait is None: self.wait = lambda attempts, delay: max( f(attempts, delay) for f in wait_funcs ) else: self.wait = getattr(self, wait) # retry on exception filter if retry_on_exception is None: self._retry_on_exception = self.always_reject else: # this allows for providing a tuple of exception types that # should be allowed to retry on, and avoids having to create # a callback that does the same thing if isinstance(retry_on_exception, (tuple)): retry_on_exception = _retry_if_exception_of_type(retry_on_exception) self._retry_on_exception = retry_on_exception # retry on result filter if retry_on_result is None: self._retry_on_result = self.never_reject else: self._retry_on_result = retry_on_result self._wrap_exception = wrap_exception def stop_after_attempt(self, previous_attempt_number, delay_since_first_attempt_ms): """Stop after the previous attempt >= stop_max_attempt_number.""" return previous_attempt_number >= self._stop_max_attempt_number def stop_after_delay(self, previous_attempt_number, delay_since_first_attempt_ms): """Stop after the time from the first attempt >= stop_max_delay.""" return delay_since_first_attempt_ms >= self._stop_max_delay @staticmethod def no_sleep(previous_attempt_number, delay_since_first_attempt_ms): """Don't sleep at all before retrying.""" return 0 def fixed_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """Sleep a fixed amount of time between each retry.""" return self._wait_fixed def random_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """Sleep a random amount of time between wait_random_min and wait_random_max""" return random.randint(self._wait_random_min, self._wait_random_max) def incrementing_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): """ Sleep an incremental amount of time after each attempt, starting at wait_incrementing_start and incrementing by wait_incrementing_increment """ result = self._wait_incrementing_start + ( self._wait_incrementing_increment * (previous_attempt_number - 1) ) if result > self._wait_incrementing_max: result = self._wait_incrementing_max if result < 0: result = 0 return result def exponential_sleep(self, previous_attempt_number, delay_since_first_attempt_ms): exp = 2**previous_attempt_number result = self._wait_exponential_multiplier * exp if result > self._wait_exponential_max: result = self._wait_exponential_max if result < 0: result = 0 return result @staticmethod def never_reject(result): return False @staticmethod def always_reject(result): return True def should_reject(self, attempt): reject = False if attempt.has_exception: reject |= self._retry_on_exception(attempt.value[1]) else: reject |= self._retry_on_result(attempt.value) return reject def call(self, fn, *args, **kwargs): start_time = int(round(time.time() * 1000)) attempt_number = 1 while True: if self._before_attempts: self._before_attempts(attempt_number) try: attempt = Attempt(fn(*args, **kwargs), attempt_number, False) except: tb = sys.exc_info() attempt = Attempt(tb, attempt_number, True) if not self.should_reject(attempt): return attempt.get(self._wrap_exception) if self._after_attempts: self._after_attempts(attempt_number) delay_since_first_attempt_ms = int(round(time.time() * 1000)) - start_time if self.stop(attempt_number, delay_since_first_attempt_ms): if not self._wrap_exception and attempt.has_exception: # get() on an attempt with an exception should cause it to be raised, but raise just in case raise attempt.get() else: raise RetryError(attempt) else: sleep = self.wait(attempt_number, delay_since_first_attempt_ms) if self._wait_jitter_max: jitter = random.random() * self._wait_jitter_max sleep = sleep + max(0, jitter) time.sleep(sleep / 1000.0) attempt_number += 1 class Attempt(object): """ An Attempt encapsulates a call to a target function that may end as a normal return value from the function or an Exception depending on what occurred during the execution. """ def __init__(self, value, attempt_number, has_exception): self.value = value self.attempt_number = attempt_number self.has_exception = has_exception def get(self, wrap_exception=False): """ Return the return value of this Attempt instance or raise an Exception. If wrap_exception is true, this Attempt is wrapped inside of a RetryError before being raised. """ if self.has_exception: if wrap_exception: raise RetryError(self) else: six.reraise(self.value[0], self.value[1], self.value[2]) else: return self.value def __repr__(self): if self.has_exception: return "Attempts: {0}, Error:\n{1}".format( self.attempt_number, "".join(traceback.format_tb(self.value[2])) ) else: return "Attempts: {0}, Value: {1}".format(self.attempt_number, self.value) class RetryError(Exception): """ A RetryError encapsulates the last Attempt instance right before giving up. """ def __init__(self, last_attempt): self.last_attempt = last_attempt def __str__(self): return "RetryError[{0}]".format(self.last_attempt)