File manager - Edit - /home/u478019808/domains/bestandroidphones.store/public_html/static/img/logo/retry-decorator.tar
Back
CHANGES.txt 0000644 00000001621 15025175625 0006365 0 ustar 00 Change-log for retry_decorator. This file will be added to as part of each release ---- Version 1.0.0, Fri 22 Nov 2013 =============================== 9254d78ccc Using seed for pypi deployment; modified to use logger rather fptr (Patrick) Version 0.1.3, Fri 22 Nov 2013 =============================== 51b175d979 Version bump to 0.1.2 and updating CHANGES.txt (Patrick) d5ab8970f7 add manifest (Patrick) Version 0.1.2 (first version), Fri 22 Nov 2013 =============================================== Version 0.1.2, Fri 22 Nov 2013 =============================== 3c01cdcd38 removed manifest (Patrick) Version 0.1.1, Fri 22 Nov 2013 =============================== 09d0b03f13 added setup.py (Patrick) 7a4fe23aa9 license and change.txt (Patrick) b985477f21 - add Makefile to generate versioned tarball - add setup.py to help with installation (Robert Schweikert) 5803da54f2 new readme (Patrick) .gitignore 0000644 00000000475 15025175625 0006552 0 ustar 00 *.py[cod] *.swp *~ venv # C extensions *.so # Packages *.egg *.egg-info dist build eggs parts bin var sdist develop-eggs .installed.cfg lib lib64 # Installer logs pip-log.txt # Unit test / coverage reports .coverage .tox nosetests.xml # Translations *.mo # Mr Developer .mr.developer.cfg .project .pydevproject setup.py 0000644 00000001115 15025175625 0006264 0 ustar 00 #!/usr/bin/env python from os.path import exists from setuptools import setup, find_packages from retry_decorator import __version__ setup( name='retry_decorator', version=__version__, author='Patrick Ng', author_email='pn.appdev@gmail.com', scripts=[], url='https://github.com/pnpnpn/retry-decorator', license='MIT', packages=find_packages(), description='Retry Decorator', long_description=open('README.rst').read() if exists("README.rst") else "", install_requires=[ ], ) README.rst 0000644 00000000722 15025175625 0006244 0 ustar 00 Usage ----- Retry decorator :: #!/usr/bin/env python from __future__ import print_function from retry_decorator import * @retry(Exception, tries = 3, timeout_secs = 0.1) def test_retry(): import sys print('hello', file = sys.stderr) raise Exception('Testing retry') if __name__ == '__main__': try: test_retry() except Exception as e: print('Received the last exception') MANIFEST.in 0000644 00000000065 15025175625 0006313 0 ustar 00 include *.txt include *.rst recursive-include docs * retry_decorator/__pycache__/retry_decorator.cpython-39.pyc 0000644 00000002330 15025175625 0020031 0 ustar 00 a (�R� � @ sB d dl mZ d dlZd dlZd dlZd dlZd dlZddd�ZdS )� )�print_functionN� � �?c s � ���fdd�}|S )zL Retry calling the decorated function using an exponential backoff. c s �� ���fdd�}|S )Nc s� �� }}|dkr�z�| i |��W S � y� } zh|d }t �|| || �}d| }�d u rjt�|� n ��|� t�|� |d8 }|d9 }W Y d }~q d }~0 0 q �| i |��S )N� g�������?zRetrying in %.2f seconds ...� )�random�uniform�logging� exception�time�sleep)�args�kwargsZmtriesZmdelay�eZ half_interval�actual_delay�msg)�ExceptionToCheck�f�logger�timeout_secs�tries� �J/opt/gsutil/third_party/retry-decorator/retry_decorator/retry_decorator.py�f_retry s z*retry.<locals>.deco_retry.<locals>.f_retryr )r r �r r r r )r r � deco_retry s zretry.<locals>.deco_retryr )r r r r r r r r �retry s r )r r N)� __future__r � tracebackr r r �sysr r r r r �<module> s retry_decorator/__pycache__/__init__.cpython-39.pyc 0000644 00000000356 15025175625 0016367 0 ustar 00 a (�Rm � @ s d dl T dZdZdS )� )�*�retry_decoratorz1.0.0N)r � __title__�__version__� r r �C/opt/gsutil/third_party/retry-decorator/retry_decorator/__init__.py�<module> s retry_decorator/retry_decorator.py 0000644 00000002246 15025175625 0013550 0 ustar 00 #!/usr/bin/env python from __future__ import print_function import traceback import logging import time import random import sys def retry(ExceptionToCheck, tries=10, timeout_secs=1.0, logger=None): """ Retry calling the decorated function using an exponential backoff. """ def deco_retry(f): def f_retry(*args, **kwargs): mtries, mdelay = tries, timeout_secs while mtries > 1: try: return f(*args, **kwargs) except ExceptionToCheck as e: #traceback.print_exc() half_interval = mdelay * 0.10 #interval size actual_delay = random.uniform(mdelay - half_interval, mdelay + half_interval) msg = "Retrying in %.2f seconds ..." % actual_delay if logger is None: logging.exception(msg) else: logger.exception(msg) time.sleep(actual_delay) mtries -= 1 mdelay *= 2 return f(*args, **kwargs) return f_retry # true decorator return deco_retry retry_decorator/__init__.py 0000644 00000000155 15025175625 0012075 0 ustar 00 # -*- coding: utf-8 -*- from .retry_decorator import * __title__ = 'retry_decorator' __version__ = "1.0.0" Makefile 0000644 00000000360 15025175625 0006213 0 ustar 00 name = $(shell grep title retry_decorator/__init__.py | cut -d "'" -f2) ver = $(shell grep version retry_decorator/__init__.py| cut -d "'" -f2 ) tar: git archive --prefix="$(name)-$(ver)/" master | bzip2 --best > "$(name)-$(ver).tar.bz2" LICENSE.txt 0000644 00000002026 15025175625 0006377 0 ustar 00 Copyright (c) 2012 PN Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| ver. 1.4 |
Github
|
.
| PHP 8.2.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings