mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 23:08:22 -05:00
Add --proctitle to paster run.
When the setproctitle module is available and --proctitle is passed, paster run will set the process title (as seen by ps, top, etc.) to the specified value.
This commit is contained in:
@@ -49,8 +49,18 @@ class RunCommand(command.Command):
|
||||
parser.add_option('-c', '--command',
|
||||
dest='command',
|
||||
help="execute command in module")
|
||||
parser.add_option("", "--proctitle",
|
||||
dest="proctitle",
|
||||
help="set the title seen by ps and top")
|
||||
|
||||
def command(self):
|
||||
try:
|
||||
if self.options.proctitle:
|
||||
import setproctitle
|
||||
setproctitle.setproctitle("paster " + self.options.proctitle)
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
here_dir = os.getcwd()
|
||||
|
||||
if self.args[0].lower() == 'standalone':
|
||||
|
||||
Reference in New Issue
Block a user