b ddlmZddlmZmZmZmZmZm Z m Z m Z m Z m Z mZmZdZddZeddfdZedddfd Zdd Zdd Zdd Zdd ZddZy)) AF_UNSPEC) __version__bootednotify _listen_fds_listen_fds_with_names_is_fifo _is_socket_is_socket_inet_is_socket_sockaddr_is_socket_unix_is_mqLISTEN_FDS_STARTcF |jS#t$r|cYSwxYwN)filenoAttributeError)fileobjs 0/usr/lib/python3/dist-packages/systemd/daemon.py_convert_fileobjrs(~~ s   Nc0t|}t||Sr)rr rpathfds ris_fifors ' "B B c4t|}t||||Sr)rr )rfamilytype listeningrs r is_socketr#s ' "B b&$ 22rc6t|}t|||||Sr)rr )rr r!r"portrs ris_socket_inetr&s ' "B 2vtY ==rc6t|}t|||||S)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 )raddressr!flowinfor"rs ris_socket_sockaddrr*"s! ' "B r7D(I FFrc4t|}t||||Sr)rr)rr!r"rrs ris_socket_unixr,0s ' "B 2tY 55rc0t|}t||Sr)rrrs ris_mqr.4s ' "B "d rcXt|}tttt|zS)aZReturn a list of socket activated descriptors Example:: (in primary window) $ systemd-socket-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] )rlistranger)unset_environmentnums r listen_fdsr48s( ' (C &(83(>? @@rclt|}i}td|dD]}|d|z||tz<|S)aReturn a dictionary of socket activated descriptors as {fd: name} Example:: (in primary window) $ systemd-socket-activate -l 2000 -l 4000 --fdname=2K:4K python3 -c \ 'from systemd.daemon import listen_fds_with_names; print(listen_fds_with_names())' (in another window) $ telnet localhost 2000 (in primary window) ... Execing python3 (...) [3] rr)r r1r)r2 compositeretvalis rlisten_fds_with_namesr9JsK''89I F 1il #4%.qs^q!!"4 Mrr)rrr)rrN)T)socketr _AF_UNSPEC_daemonrrrrr r r r r rrrrrr#r&r*r,r.r4r9rrr>s_* ( ( ( ( )qB3$.A!> G6A$r