Skip to content

Commit 61db205

Browse files
committed
Adding egg structure. Now 'python setup.py install' will create a script called 'daemonize' that calls python_daemonize.daemonize.main
1 parent 31d8347 commit 61db205

11 files changed

Lines changed: 92 additions & 1 deletion

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build
2+
dist
3+
*.pyc
4+
*.pyo

python_daemonize.egg-info/PKG-INFO

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Metadata-Version: 1.0
2+
Name: python-daemonize
3+
Version: 0.1dev
4+
Summary: Simple daemonization utility based on BSD daemon(3)
5+
Home-page: http://github.com/lutzky/python_daemonize
6+
Author: Ohad Lutzky
7+
Author-email: ohad@lutzky.net
8+
License: UNKNOWN
9+
Description: Simple daemonization utility based on BSD daemon(3)
10+
11+
Usage from within python:
12+
- import daemonize
13+
- run daemonize.daemon() at the appropriate time
14+
15+
Usage from the shell:
16+
daemonize.py [path] [arguments]
17+
18+
Note that [path] has to be a full path to an executable file
19+
20+
Ported from Brian Clapper's daemonize at
21+
http://www.clapper.org/software/daemonize/
22+
23+
Keywords: daemon daemonize
24+
Platform: UNKNOWN
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
setup.cfg
2+
setup.py
3+
python_daemonize/__init__.py
4+
python_daemonize/daemonize.py
5+
python_daemonize.egg-info/PKG-INFO
6+
python_daemonize.egg-info/SOURCES.txt
7+
python_daemonize.egg-info/dependency_links.txt
8+
python_daemonize.egg-info/entry_points.txt
9+
python_daemonize.egg-info/not-zip-safe
10+
python_daemonize.egg-info/top_level.txt
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[console_scripts]
2+
daemonize = python_daemonize.daemonize:main
3+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python_daemonize

python_daemonize/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from daemonize import daemon

daemonize.py renamed to python_daemonize/daemonize.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def redirect_fds():
5252
if not nochdir: os.chdir("/")
5353
if not noclose: redirect_fds()
5454

55-
if __name__ == '__main__':
55+
def main():
5656
def die(error):
5757
sys.stderr.write("%s\n" % error)
5858
sys.exit(1)
@@ -74,3 +74,6 @@ def die(error):
7474

7575
daemon(0,0)
7676
os.execv(sys.argv[1], sys.argv[1:])
77+
78+
if __name__ == '__main__':
79+
main()

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[egg_info]
2+
tag_build = dev
3+
tag_svn_revision = true

0 commit comments

Comments
 (0)