/usr/lib/python3.6/site-packages/slip/dbus/__pycache__
Edit: /usr/lib/python3.6/site-packages/slip/dbus/__pycache__/mainloop.cpython-36.pyc (3170B)
3
ˆuAc#
ã @ s@ d Z ddlmZ d
ZG dd„ deƒZG dd„ deƒZdd„ Zd S )zVThis module contains mainloop wrappers.
Currently only glib main loops are supported.é )Úabsolute_importÚMainLoopÚset_typec sX e Zd ZdZdZ‡ fdd„Zedd„ ƒZdd„ Zd d
„ Z dd„ Z
d
d„ Zdd„ Z‡ Z
S )r a An abstract main loop wrapper class and factory.
Use MainLoop() to get a main loop wrapper object for a main loop type
previously registered with set_type(). Defaults to glib main loops.
Actual main loop wrapper classes are derived from this class.Nc s. t jd krt jdƒ tt | ƒjt jf|ž|ŽS )NÚglib)r Z_mainloop_classr ÚsuperÚ__new__Ú_MainLoop__mainloop_class)ÚclsÚargsÚkwargs)Ú __class__© ú/usr/lib/python3.6/mainloop.pyr * s
zMainLoop.__new__c C sH t jdk rtdƒ‚dti}||kr.|| t _ntd|dj|ƒf ƒ‚dS )zxSet a main loop type for non-blocking interfaces.
mltype: "glib" (currently only glib main loops are supported)Nz(The main loop type can only be set once.r z0'%s' is not one of the valid main loop types:
%sz, )r r ÚRuntimeErrorÚGlibMainLoopÚ
ValueErrorÚjoin)r ÚmltypeZ
ml_type_classr
r
r r 1 s
zMainLoop.set_typec C s
t ƒ ‚dS )z$Returns if there are pending events.N)ÚNotImplementedError)Úselfr
r
r ÚpendingC s zMainLoop.pendingc C s
t ƒ ‚dS )z Iterates over one pending event.N)r )r r
r
r ÚiterateH s zMainLoop.iteratec C s x| j ƒ r| jƒ qW dS )z!Iterates over all pending events.N)r r )r r
r
r Úiterate_over_pending_eventsM s
z$MainLoop.iterate_over_pending_eventsc C s
t ƒ ‚dS )zRuns the main loop.N)r )r r
r
r ÚrunS s zMainLoop.runc C s
t ƒ ‚dS )zQuits the main loop.N)r )r r
r
r ÚquitX s z
MainLoop.quit)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r Úclassmethodr r r r r r Ú
__classcell__r
r
)r r r s c @ s e Zd Zdd„ ZdS )r c C sF ddl m} |jƒ }|jƒ }|| _|j| _|j| _|j| _|j | _ d S )Né )Ú_glib)
Z _wrappersr" r Zget_contextZ _mainloopr Z iterationr r r )r r" ZmlZctxr
r
r Ú__init__` s zGlibMainLoop.__init__N)r r r r# r
r
r
r r ^ s r c C s$ ddl m} |dtƒ tj| ƒ dS )z¦Set a main loop type for non-blocking interfaces.
mltype: "glib" (currently only glib main loops are supported)
Deprecated, use MainLoop.set_type() instead.r )Úwarnzuse MainLoop.set_type() insteadN)Úwarningsr$ ÚDeprecationWarningr r )r r$ r
r
r r l s
N)r r )r Z
__future__r Ú__all__Úobjectr r r r
r
r
r Ú
s
>