/
usr
/
lib
/
python3
/
dist-packages
/
twisted
/
python
/
/usr/lib/python3/dist-packages/twisted/python
mkdir
upload
Name
Size
Mode
Actions
test/
-
0755
rm
_pydoctortemplates/
-
0755
rm
__pycache__/
-
0755
rm
compat.py
23194
0644
edit
dl
rm
components.py
14295
0644
edit
dl
rm
constants.py
544
0644
edit
dl
rm
context.py
4024
0644
edit
dl
rm
deprecate.py
26775
0644
edit
dl
rm
failure.py
26638
0644
edit
dl
rm
fakepwd.py
6138
0644
edit
dl
rm
filepath.py
58887
0644
edit
dl
rm
formmethod.py
11460
0644
edit
dl
rm
htmlizer.py
3541
0644
edit
dl
rm
lockfile.py
7718
0644
edit
dl
rm
log.py
22472
0644
edit
dl
rm
logfile.py
10083
0644
edit
dl
rm
modules.py
27141
0644
edit
dl
rm
monkey.py
2227
0644
edit
dl
rm
procutils.py
1419
0644
edit
dl
rm
randbytes.py
3959
0644
edit
dl
rm
rebuild.py
9268
0644
edit
dl
rm
reflect.py
19477
0644
edit
dl
rm
release.py
1192
0644
edit
dl
rm
roots.py
7404
0644
edit
dl
rm
runtime.py
6270
0644
edit
dl
rm
sendmsg.py
3420
0644
edit
dl
rm
shortcut.py
2253
0644
edit
dl
rm
syslog.py
3730
0644
edit
dl
rm
systemd.py
2834
0644
edit
dl
rm
text.py
5482
0644
edit
dl
rm
threadable.py
3297
0644
edit
dl
rm
threadpool.py
9840
0644
edit
dl
rm
twisted-completion.zsh
1371
0644
edit
dl
rm
url.py
244
0644
edit
dl
rm
urlpath.py
9084
0644
edit
dl
rm
usage.py
35010
0644
edit
dl
rm
util.py
27931
0644
edit
dl
rm
versions.py
322
0644
edit
dl
rm
win32.py
4317
0644
edit
dl
rm
zippath.py
9237
0644
edit
dl
rm
zipstream.py
9757
0644
edit
dl
rm
_appdirs.py
788
0644
edit
dl
rm
_inotify.py
3455
0644
edit
dl
rm
_oldstyle.py
2593
0644
edit
dl
rm
_release.py
18548
0644
edit
dl
rm
_setup.py
12953
0644
edit
dl
rm
_shellcomp.py
24830
0644
edit
dl
rm
_textattributes.py
9079
0644
edit
dl
rm
_tzhelper.py
3192
0644
edit
dl
rm
_url.py
253
0644
edit
dl
rm
__init__.py
674
0644
edit
dl
rm
Edit:
/usr/lib/python3/dist-packages/twisted/python/systemd.py
(2834B)
# -*- test-case-name: twisted.python.test.test_systemd -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Integration with systemd. Currently only the minimum APIs necessary for using systemd's socket activation feature are supported. """ from __future__ import division, absolute_import __all__ = ['ListenFDs'] from os import getpid class ListenFDs(object): """ L{ListenFDs} provides access to file descriptors inherited from systemd. Typically L{ListenFDs.fromEnvironment} should be used to construct a new instance of L{ListenFDs}. @cvar _START: File descriptors inherited from systemd are always consecutively numbered, with a fixed lowest "starting" descriptor. This gives the default starting descriptor. Since this must agree with the value systemd is using, it typically should not be overridden. @type _START: C{int} @ivar _descriptors: A C{list} of C{int} giving the descriptors which were inherited. """ _START = 3 def __init__(self, descriptors): """ @param descriptors: The descriptors which will be returned from calls to C{inheritedDescriptors}. """ self._descriptors = descriptors @classmethod def fromEnvironment(cls, environ=None, start=None): """ @param environ: A dictionary-like object to inspect to discover inherited descriptors. By default, L{None}, indicating that the real process environment should be inspected. The default is suitable for typical usage. @param start: An integer giving the lowest value of an inherited descriptor systemd will give us. By default, L{None}, indicating the known correct (that is, in agreement with systemd) value will be used. The default is suitable for typical usage. @return: A new instance of C{cls} which can be used to look up the descriptors which have been inherited. """ if environ is None: from os import environ if start is None: start = cls._START descriptors = [] try: pid = int(environ['LISTEN_PID']) except (KeyError, ValueError): pass else: if pid == getpid(): try: count = int(environ['LISTEN_FDS']) except (KeyError, ValueError): pass else: descriptors = range(start, start + count) del environ['LISTEN_PID'], environ['LISTEN_FDS'] return cls(descriptors) def inheritedDescriptors(self): """ @return: The configured list of descriptors. """ return list(self._descriptors)
Save
cmd:
run