Esempio n. 1
0
def set_process_title(progname, info=None):
    """Set the ps name for the currently running process
    if :mod`setproctitle` is installed."""
    if _setproctitle:
        proctitle = "[%s]" % progname
        proctitle = info and "%s %s" % (proctitle, info) or proctitle
        _setproctitle(proctitle)
Esempio n. 2
0
def setproctitle(x):
    try:
        from setproctitle import setproctitle as _setproctitle

        _setproctitle(x)
    except ImportError:
        pass
def set_process_title(progname, info=None):
    """Set the ps name for the currently running process.

    Only works if :mod`setproctitle` is installed.

    """
    proctitle = "[%s]" % progname
    proctitle = info and "%s %s" % (proctitle, info) or proctitle
    if _setproctitle:
        _setproctitle(proctitle)
    return proctitle
Esempio n. 4
0
def set_process_title(progname, info=None):
    """Set the ps name for the currently running process.

    Only works if :mod:`setproctitle` is installed.

    """
    proctitle = "[%s]" % progname
    proctitle = info and "%s %s" % (proctitle, info) or proctitle
    if _setproctitle:
        _setproctitle(proctitle)
    return proctitle
Esempio n. 5
0
def setproctitle(title):
	from accelerator import g
	if hasattr(g, 'params'):
		title = '%s %s (%s)' % (g.job, uni(title), g.params.method,)
	elif hasattr(g, 'job'):
		title = '%s %s' % (g.job, uni(title),)
	else:
		title = uni(title)
	if PY2:
		title = title.encode('utf-8')
	_setproctitle(title)
Esempio n. 6
0
def setproctitle(title):
    import g
    if hasattr(g, 'METHOD'):
        title = '%s %s (%s)' % (
            g.JOBID,
            uni(title),
            g.METHOD,
        )
    else:
        title = '%s %s' % (
            g.JOBID,
            uni(title),
        )
    if PY2:
        title = title.encode('utf-8')
    _setproctitle(title)
Esempio n. 7
0
def setproctitle(x):
    try:
        from setproctitle import setproctitle as _setproctitle
        _setproctitle(x)
    except ImportError:
        pass
Esempio n. 8
0
 def setproctitle(title):
     _setproctitle("huskar: %s" % title)
Esempio n. 9
0
 def setproctitle(title):
     _setproctitle("vos: %s" % title)
Esempio n. 10
0
def set_process_title(progname, info=None):
    if _setproctitle:
        proctitle = "[%s]" % progname
        proctitle = info and "%s %s" % (proctitle, info) or proctitle
        _setproctitle(proctitle)