Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 u1‘Wkã@s”dZddlmZddlmZddlmZddlmZddlZddlmZGdd „d e ƒZ Gd d „d e ƒZ d d „Z Gdd„de ƒZ Gdd„de ƒZdS)z• pyudev._qt_base =============== Base mixin class for Qt4,Qt5 support. .. moduleauthor:: Sebastian Wiesner é)Úabsolute_import)Údivision)Úprint_function)Úunicode_literalsN)ÚDevicec@sBeZdZdZdd„Zedd„ƒZejdd„ƒZdd„Zd d „Z d S) ÚMonitorObserverMixinz0 Base mixin for pyqt monitor observers. cCs2||_||jƒ|j|ƒ|_|jjtj|jƒdS)N)ÚmonitorÚfilenoZReadÚnotifierZ activatedÚintZconnectÚ_process_udev_event)ÚselfrÚnotifier_class©rú/usr/lib/python3.6/_qt_base.pyÚ_setup_notifier+sz$MonitorObserverMixin._setup_notifiercCs |jjƒS)aY Whether this observer is enabled or not. If ``True`` (the default), this observer is enabled, and emits events. Otherwise it is disabled and does not emit any events. This merely reflects the state of the ``enabled`` property of the underlying :attr:`notifier`. .. versionadded:: 0.14 )r Z isEnabled)r rrrÚenabled1s zMonitorObserverMixin.enabledcCs|jj|ƒdS)N)r Z setEnabled)r Úvaluerrrr?scCs$|jjdd�}|dk r |j|ƒdS)zê Attempt to receive a single device event from the monitor, process the event and emit corresponding signals. Called by ``QSocketNotifier``, if data is available on the udev monitoring socket. r)ZtimeoutN)rZpollÚ _emit_event)r Údevicerrrr Csz(MonitorObserverMixin._process_udev_eventcCs|jj|ƒdS)N)Ú deviceEventÚemit)r rrrrrOsz MonitorObserverMixin._emit_eventN) Ú__name__Ú __module__Ú __qualname__Ú__doc__rÚpropertyrÚsetterr rrrrrr%s   rc@s eZdZdZdd„Zdd„ZdS)ÚQUDevMonitorObserverMixinz* Obsolete monitor observer mixin. cCs>tj|||ƒ|j|j|j|jdœ|_ddl}|jdt ƒdS)N)ÚaddÚremoveZchangeZmoverzAWill be removed in 1.0. Use pyudev.pyqt4.MonitorObserver instead.) rrÚ deviceAddedÚ deviceRemovedÚ deviceChangedÚ deviceMovedÚ_action_signal_mapÚwarningsÚwarnÚDeprecationWarning)r rrr&rrrrYs z)QUDevMonitorObserverMixin._setup_notifiercCs4|jj|j|ƒ|jj|jƒ}|dk r0|j|ƒdS)N)rrÚactionr%Úget)r rÚsignalrrrrdsz%QUDevMonitorObserverMixin._emit_eventN)rrrrrrrrrrrSs rcsd‡‡fdd„ }|S)a Generates an initializer to observer the given ``monitor`` (a :class:`~pyudev.Monitor`): ``parent`` is the parent :class:`~PyQt{4,5}.QtCore.QObject` of this object. It is passed unchanged to the inherited constructor of :class:`~PyQt{4,5}.QtCore.QObject`. Ncsˆj||ƒ|j|ˆƒdS)N)Ú__init__r)r rÚparent)ÚqobjectÚsocket_notifierrrr,ts zmake_init..__init__)Nr)r.r/r,r)r.r/rÚ make_initjs r0c@seZdZdZedd„ƒZdS)ÚMonitorObserverGeneratorz4 Class to generate a MonitorObserver class. cCs.ttdƒ|tftdƒt||ƒtdƒ|tƒiƒS)aGenerates an observer for device events integrating into the PyQt{4,5} mainloop. This class inherits :class:`~PyQt{4,5}.QtCore.QObject` to turn device events into Qt signals: >>> from pyudev import Context, Monitor >>> from pyudev.pyqt4 import MonitorObserver >>> context = Context() >>> monitor = Monitor.from_netlink(context) >>> monitor.filter_by(subsystem='input') >>> observer = MonitorObserver(monitor) >>> def device_event(device): ... print('event {0} on device {1}'.format(device.action, device)) >>> observer.deviceEvent.connect(device_event) >>> monitor.start() This class is a child of :class:`~{PySide, PyQt{4,5}}.QtCore.QObject`. ZMonitorObserverr,r)ÚtypeÚstrrr0r)r.r+r/rrrÚmake_monitor_observer‚s z.MonitorObserverGenerator.make_monitor_observerN)rrrrÚ staticmethodr4rrrrr1|sr1c@seZdZdZedd„ƒZdS)ÚQUDevMonitorObserverGeneratorz4 Class to generate a MonitorObserver class. cCsbttdƒ|tftdƒt||ƒtdƒ|tjtƒtdƒ|tƒtdƒ|tƒtdƒ|tƒtdƒ|tƒiƒS)aGenerates an observer for device events integrating into the PyQt{4,5} mainloop. This class inherits :class:`~PyQt{4,5}.QtCore.QObject` to turn device events into Qt signals: >>> from pyudev import Context, Monitor >>> from pyudev.pyqt4 import MonitorObserver >>> context = Context() >>> monitor = Monitor.from_netlink(context) >>> monitor.filter_by(subsystem='input') >>> observer = MonitorObserver(monitor) >>> def device_event(device): ... print('event {0} on device {1}'.format(device.action, device)) >>> observer.deviceEvent.connect(device_event) >>> monitor.start() This class is a child of :class:`~{PyQt{4,5}, PySide}.QtCore.QObject`. ZQUDevMonitorObserverr,rr!r"r#r$)r2r3rr0ÚsixZ text_typer)r.r+r/rrrr4©s   z3QUDevMonitorObserverGenerator.make_monitor_observerN)rrrrr5r4rrrrr6£sr6)rZ __future__rrrrr7Z pyudev.devicerÚobjectrrr0r1r6rrrrÚs     .'