mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix issue #143. unnecessary list().
This commit is contained in:
parent
c21578df40
commit
dbc61f310e
@ -60,7 +60,7 @@ class Application(object):
|
|||||||
|
|
||||||
# Load up the any app specific configuration
|
# Load up the any app specific configuration
|
||||||
if cfg:
|
if cfg:
|
||||||
for k, v in list(cfg.items()):
|
for k, v in cfg.items():
|
||||||
self.cfg.set(k.lower(), v)
|
self.cfg.set(k.lower(), v)
|
||||||
|
|
||||||
# Load up the config file if its found.
|
# Load up the config file if its found.
|
||||||
@ -79,7 +79,7 @@ class Application(object):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
for k, v in list(cfg.items()):
|
for k, v in cfg.items():
|
||||||
# Ignore unknown names
|
# Ignore unknown names
|
||||||
if k not in self.cfg.settings:
|
if k not in self.cfg.settings:
|
||||||
continue
|
continue
|
||||||
@ -91,7 +91,7 @@ class Application(object):
|
|||||||
|
|
||||||
# Lastly, update the configuration with any command line
|
# Lastly, update the configuration with any command line
|
||||||
# settings.
|
# settings.
|
||||||
for k, v in list(opts.__dict__.items()):
|
for k, v in opts.__dict__.items():
|
||||||
if v is None:
|
if v is None:
|
||||||
continue
|
continue
|
||||||
self.cfg.set(k.lower(), v)
|
self.cfg.set(k.lower(), v)
|
||||||
|
|||||||
@ -125,7 +125,7 @@ class DjangoApplicationCommand(Application):
|
|||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
for k, v in list(cfg.items()):
|
for k, v in cfg.items():
|
||||||
# Ignore unknown names
|
# Ignore unknown names
|
||||||
if k not in self.cfg.settings:
|
if k not in self.cfg.settings:
|
||||||
continue
|
continue
|
||||||
@ -135,7 +135,7 @@ class DjangoApplicationCommand(Application):
|
|||||||
sys.stderr.write("Invalid value for %s: %s\n\n" % (k, v))
|
sys.stderr.write("Invalid value for %s: %s\n\n" % (k, v))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
for k, v in list(self.options.items()):
|
for k, v in self.options.items():
|
||||||
if k.lower() in self.cfg.settings and v is not None:
|
if k.lower() in self.cfg.settings and v is not None:
|
||||||
self.cfg.set(k.lower(), v)
|
self.cfg.set(k.lower(), v)
|
||||||
|
|
||||||
|
|||||||
@ -110,12 +110,12 @@ class PasterServerApplication(PasterBaseApplication):
|
|||||||
cfg["bind"] = bind
|
cfg["bind"] = bind
|
||||||
|
|
||||||
if gcfg:
|
if gcfg:
|
||||||
for k, v in list(gcfg.items()):
|
for k, v in gcfg.items():
|
||||||
cfg[k] = v
|
cfg[k] = v
|
||||||
cfg["default_proc_name"] = cfg['__file__']
|
cfg["default_proc_name"] = cfg['__file__']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for k, v in list(cfg.items()):
|
for k, v in cfg.items():
|
||||||
if k.lower() in self.cfg.settings and v is not None:
|
if k.lower() in self.cfg.settings and v is not None:
|
||||||
self.cfg.set(k.lower(), v)
|
self.cfg.set(k.lower(), v)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|||||||
@ -373,7 +373,7 @@ class Arbiter(object):
|
|||||||
"""\
|
"""\
|
||||||
Kill unused/idle workers
|
Kill unused/idle workers
|
||||||
"""
|
"""
|
||||||
for (pid, worker) in list(self.WORKERS.items()):
|
for (pid, worker) in self.WORKERS.items():
|
||||||
try:
|
try:
|
||||||
diff = time.time() - os.fstat(worker.tmp.fileno()).st_ctime
|
diff = time.time() - os.fstat(worker.tmp.fileno()).st_ctime
|
||||||
if diff <= self.timeout:
|
if diff <= self.timeout:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user