##// END OF EJS Templates
restore master behavior...
restore master behavior up arrow at the top line first goes to char 0, and only goes to the cell above if already on char 0. Same with down arrow on the bottom line: transition cursor to the end of the line, and only go down a cell if already at the end of the last line. this makes for an unhappy experience in code-mirror's vim mode for j and k keys, but we'll fix that in the next commit

File last commit:

r7787:28b538a9
r15835:dc3c98b8
Show More
daemonize.py
26 lines | 833 B | text/x-python | PythonLexer
MinRK
scrub twisted/deferred references from launchers...
r4019 """daemonize function from twisted.scripts._twistd_unix."""
#-----------------------------------------------------------------------------
# Copyright (c) Twisted Matrix Laboratories.
# See Twisted's LICENSE for details.
# http://twistedmatrix.com/
#-----------------------------------------------------------------------------
import os, errno
def daemonize():
# See http://www.erlenstar.demon.co.uk/unix/faq_toc.html#TOC16
if os.fork(): # launch child and...
os._exit(0) # kill off parent
os.setsid()
if os.fork(): # launch child and...
os._exit(0) # kill off parent again.
null = os.open('/dev/null', os.O_RDWR)
for i in range(3):
try:
os.dup2(null, i)
Matthias BUSSONNIER
conform to pep 3110...
r7787 except OSError as e:
MinRK
scrub twisted/deferred references from launchers...
r4019 if e.errno != errno.EBADF:
raise
os.close(null)