forked from samuelclay/NewsBlur
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Woo - Checking for content and title differences to resolve duplicate…
… entries. Integration tests prove a number of differences are successfully resolved.
- Loading branch information
1 parent
bdd91d7
commit 9e522ca
Showing
6 changed files
with
88 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import os | ||
import errno | ||
|
||
def daemonize(): | ||
""" | ||
Detach from the terminal and continue as a daemon. | ||
""" | ||
# swiped from twisted/scripts/twistd.py | ||
# 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. | ||
os.umask(077) | ||
null = os.open("/dev/null", os.O_RDWR) | ||
for i in range(3): | ||
try: | ||
os.dup2(null, i) | ||
except OSError, e: | ||
if e.errno != errno.EBADF: | ||
raise | ||
os.close(null) |