apenwarr-redo/redo/title.py
Avery Pennarun 29f939013e Add a bunch of missing python docstrings.
This appeases pylint, so un-disable its docstring warning.
2018-12-14 09:03:53 +00:00

18 lines
554 B
Python

"""Code for manipulating the Unix process title."""
import os, sys
# FIXME: setproctitle module is only usable if *not* using python -S,
# and without -S, python startup time is annoyingly longer
try:
from setproctitle import setproctitle
except ImportError:
def setproctitle(name):
pass
def auto():
"""Automatically clean up the title as seen by 'ps', based on argv."""
exe = sys.argv[0]
exename, ext = os.path.splitext(os.path.basename(sys.argv[0]))
title = ' '.join([exename] + sys.argv[1:])
setproctitle(title)