##// END OF EJS Templates
make paste focuses the pasted cell...
make paste focuses the pasted cell This is to make paste behave in the same manner that insert cell above and below currently work (inserting a new item causes that item to receive focus). This solves a problem where, if a user pastes below a cell whose bottom edge is below the current viewing area, they have no indication that any action has occurred. The same applies for paste above a cell whose top edge is occluded.

File last commit:

r7787:28b538a9
r14972:6eadb014
Show More
daemonize.py
26 lines | 833 B | text/x-python | PythonLexer
"""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)
except OSError as e:
if e.errno != errno.EBADF:
raise
os.close(null)