o ‡×Xáã@s ddlmZddlmZmZmZmZmZm Z m Z m Z m Z m Z mZdd„Zddd„Zedd fd d „Zedd dfd d „Zddd„Zddd„Zddd„Zddd„ZdS)é)Ú AF_UNSPECé) Ú __version__ÚbootedÚnotifyÚ _listen_fdsÚ_is_fifoÚ _is_socketÚ_is_socket_inetÚ_is_socket_sockaddrÚ_is_socket_unixÚ_is_mqÚLISTEN_FDS_STARTcCs"z| ¡WSty|YSw©N)ÚfilenoÚAttributeError)Úfileobj©rú0/usr/lib/python3/dist-packages/systemd/daemon.pyÚ_convert_fileobjs   ÿrNcCót|ƒ}t||ƒSr)rr©rÚpathÚfdrrrÚis_fifoó réÿÿÿÿcCót|ƒ}t||||ƒSr)rr )rÚfamilyÚtypeÚ listeningrrrrÚ is_socketór!cCót|ƒ}t|||||ƒSr)rr )rrrr ÚportrrrrÚis_socket_inetsr%cCr#)aaCheck socket type, address and/or port, flowinfo, listening state. Wraps sd_is_socket_inet_sockaddr(3). `address` is a systemd-style numerical IPv4 or IPv6 address as used in ListenStream=. A port may be included after a colon (":"). See systemd.socket(5) for details. Constants for `family` are defined in the socket module. )rr )rÚaddressrÚflowinfor rrrrÚis_socket_sockaddr!s r(cCrr)rr )rrr rrrrrÚis_socket_unix/r"r)cCrr)rr rrrrÚis_mq3rr*TcCst|ƒ}tttt|ƒƒS)aSReturn a list of socket activated descriptors Example:: (in primary window) $ systemd-activate -l 2000 python3 -c \ 'from systemd.daemon import listen_fds; print(listen_fds())' (in another window) $ telnet localhost 2000 (in primary window) ... Execing python3 (...) [3] )rÚlistÚranger)Úunset_environmentÚnumrrrÚ listen_fds7sr/r)rrr)rrN)T)ÚsocketrÚ _AF_UNSPECÚ_daemonrrrrrr r r r r rrrr!r%r(r)r*r/rrrrÚs 4