Repository URL to install this package:
Version:
3.4.35 ▾
|
ó EYc @ s d d l Z d d l Z d d l Z d d l m Z d d l m Z d d d d g Z e Z d e f d YZ d Z d Z d Z d S( iÿÿÿÿN( t greenlets( t get_hubt Timeoutt with_timeoutt wrap_is_timeoutt is_timeoutc B sq e Z d Z d d d Z d Z e d Z d Z d Z d Z d Z d Z e d Z RS( s. Raises *exception* in the current greenthread after *timeout* seconds. When *exception* is omitted or ``None``, the :class:`Timeout` instance itself is raised. If *seconds* is None, the timer is not scheduled, and is only useful if you're planning to raise it directly. Timeout objects are context managers, and so can be used in with statements. When used in a with statement, if *exception* is ``False``, the timeout is still raised, but the context manager suppresses it, so the code outside the with-block won't see it. c C s) | | _ | | _ d | _ | j d S( N( t secondst exceptiont Nonet timert start( t selfR R ( ( sE /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/timeout.pyt __init__3 s c C s® | j s t d | | j d k r5 d | _ nu | j d k sV t | j t r t j | j t j j | | _ n* t j | j t j j | j | _ | S( s Schedule the timeout. This is called on construction, so it should not be called explicitly, unless the timer has been canceled.s5 %r is already started; to restart it, cancel it firstN( t pendingt AssertionErrorR R R R t isinstancet boolR t schedule_call_globalt greenlett getcurrentt throw( R ( ( sE /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/timeout.pyR 9 s ! ! !c C s! | j d k r | j j St Sd S( s. True if the timeout is scheduled to be raised.N( R R R t False( R ( ( sE /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/timeout.pyR I s c C s, | j d k r( | j j d | _ n d S( s2 If the timeout is pending, cancel it. If not using Timeouts in ``with`` statements, always call cancel() in a ``finally`` after the block of code that is getting timed out. If not canceled, the timeout will be raised later on, in some unexpected section of the application.N( R R t cancel( R ( ( sE /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/timeout.pyR Q s c C so | j j } | j r d } n d } | j d k r<