check for this running file

pull/3/head
Luis Correia 2016-04-04 00:01:23 +01:00 zatwierdzone przez Rui Carmo
rodzic 42c201b413
commit 9cb58919c1
1 zmienionych plików z 5 dodań i 7 usunięć

12
piku.py
Wyświetl plik

@ -256,11 +256,9 @@ def spawn_worker(app, kind, command, env, ordinal=1):
if kind == 'wsgi':
echo("-----> Setting HTTP port to %s" % env['PORT'], fg='yellow')
settings.extend([
('module', command),
('threads', '4'),
('plugin', 'python'),
('http', ':%s' % env['PORT']),
('http-socket', ':%s' % env['PORT']),
('module', command),
('threads', '4'),
('http', ':%s' % env['PORT'])
])
else:
settings.append(('attach-daemon', command))
@ -548,7 +546,7 @@ def init_paths():
echo("Creating '%s'." % p, fg='green')
os.makedirs(p)
# mark this script as executable (in case we were invoked via interpreter)
if not(os.stat(this_script).st_mode & stat.S_IXUSR):
if not(os.stat(__file__).st_mode & stat.S_IXUSR):
echo("Setting '%s' as executable." % this_script, fg='yellow')
os.chmod(realpath(this_script), os.stat(this_script).st_mode | stat.S_IXUSR)
@ -633,4 +631,4 @@ cat | PIKU_ROOT="%s" %s git-hook %s""" % (PIKU_ROOT, realpath(__file__), app))
if __name__ == '__main__':
piku()
piku()