{ "info": { "author": "Johan Nestaas", "author_email": "johannestaas@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Console", "Environment :: MacOS X", "Environment :: Win32 (MS Windows)", "Environment :: X11 Applications :: Qt", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Programming Language :: Python" ], "description": "angelic\n=======\n\nAn API for daemonization\n\nInstallation\n------------\n\nFrom the project root directory::\n\n $ python setup.py install\n\nOr just install with pip::\n\n $ pip install angelic\n\nUsage\n-----\n\nAdd it to the top of your programs::\n\n from angelic import Daemon\n daemon = Daemon('app_name')\n\nThen wrap your looping function::\n \n @daemon.daemonize\n def loop(...):\n while True:\n ...\n\nOr specify an interval and have it loop automatically and wait specified seconds::\n\n @daemon.daemonize(interval=10)\n def loop(...):\n ...\n\nThen add to the bottom of your program::\n\n daemon.run(...)\n\nThe arguments to the daemonized function will be passed from the call to run.\n\nCheck Argument Parsing below for more options for starting and stopping your daemon.\n\nSee an example implementation here: http://pastebin.com/uZjxU99S\n\nConfiguration\n-------------\n\nSpecify a pid_path with that keyword. Otherwise, it will look for pid_path in all\nof the possible config paths, and last, /var/run/$DAEMON_NAME.pid will be chosen::\n\n daemon = Daemon('myapp', pid_path='~/myapp.pid')\n\nThe configuration files will be loaded automatically based on the name of the app, unless\nconfig_path is passed to Daemon. See the pypi package confutil_ for more information\nabout the configuration logic and usage.\n\n.. _confutil: https://pypi.python.org/pypi/confutil\n\nThe order that configuration files will be parsed, from most authoritative to least is\n(for a daemon named 'spam'):\n\n - ./.spam.conf\n - ./.spam.cfg\n - ~/.spam.conf\n - ~/.spam.cfg\n - ~/.config/.spam.conf\n - ~/.config/.spam.cfg\n - ~/.config/spam/config.conf\n - ~/.config/spam/config.cfg\n - ~/.config/spam/config\n - /etc/.spam.conf\n - /etc/.spam.cfg\n - /etc/spam/config.conf\n - /etc/spam/config.cfg\n - /etc/spam/config\n\nTo specify an explicit configuration file, pass in the path. The interface will be like a dict,\nspecifically a ConfigObj object::\n\n daemon = Daemon('myapp', config_path='~/.myapp.config')\n password = daemon.config['password']\n\nRedirecting STDOUT or STDERR\n----------------------------\n\nBy default, the daemon will still print its stderr to stderr, and squelch stdout.\nTo change this behavior, either set the keywords to themself, or None for muting::\n\n # prints stderr to stderr\n daemon = Daemon('myapp')\n # Keeps stdout, but mutes stderr\n daemon = Daemon('myapp', stdout='stdout', stderr=None)\n # Mutes both stdout and stderr\n daemon = Daemon('myapp', stderr=None)\n # Writes stderr to a file at path /var/log/myapp_raw_stderr\n daemon = Daemon('myapp', stderr='/var/log/myapp_raw_stderr')\n\nIt is recommended to keep stderr (default) so that you can debug exceptions in your program.\n \nLogging\n-------\n\nA simple logger can be instanciated with the Daemon by passing in an argument to its\nlog paths. For example::\n\n daemon = Daemon(debug_log='/var/log/myapp_debug.log', error_log='/var/log/myapp_error.log')\n daemon.log.error('Encountered an error!')\n\nOther possible logger arguments are info_log, warning_log, and critical_log.\nIf not provided in the keyword arguments, the configuration will be checked for debug_log, etc.\n\n\nArgument Parsing\n----------------\n\nA simple start, stop, restart, status interface can be given with the following code::\n\n daemon.parse_args()\n\nTo add arguments to the start command which will pass to the loop, do the following, create the subparsers first::\n \n @daemonize\n def loop(debug=False):\n ...\n\n def main():\n import argparse\n parser = argparse.ArgumentParser()\n subparsers = daemon.setup_args(parser)\n subparsers['start'].add_argument('--debug', '-d', action='store_true')\n daemon.parse_args(parser)\n \nRelease Notes\n-------------\n\n:0.1.2:\n Just updated README with the simpler argparse functionality.\n:0.1.1:\n Removed requirement to create argparser ArgumentParser.\n Now, start/stop/restart/status interface can be created with just `daemon.parse_args()`\n:0.1.0:\n Daemonization works according to examples in this README\n:0.0.1:\n Project created", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.bitbucket.org/johannestaas/angelic", "keywords": "", "license": "GPLv3+", "maintainer": "", "maintainer_email": "", "name": "angelic", "package_url": "https://pypi.org/project/angelic/", "platform": "", "project_url": "https://pypi.org/project/angelic/", "project_urls": { "Homepage": "https://www.bitbucket.org/johannestaas/angelic" }, "release_url": "https://pypi.org/project/angelic/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "An API for daemonization", "version": "0.1.3" }, "last_serial": 4088013, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "14c6438d3714b7e0341e07b22834737d", "sha256": "797c189758db3709ad7bb4c7ab976a004fd7dadd3742df64c7048bf3c54290c7" }, "downloads": -1, "filename": "angelic-0.0.1.tar.gz", "has_sig": false, "md5_digest": "14c6438d3714b7e0341e07b22834737d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2155, "upload_time": "2015-12-17T08:42:41", "url": "https://files.pythonhosted.org/packages/b9/05/9fd99266db10c0d545fb72d8651f9d3e8a72dc36257fb7191dc4f52f514d/angelic-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "eb8ea83c90330009824cb43d52000ffe", "sha256": "27873b7cdb8e1842ef30d112be678866e2a82b54fe591073260b49a155fc986d" }, "downloads": -1, "filename": "angelic-0.1.0.tar.gz", "has_sig": false, "md5_digest": "eb8ea83c90330009824cb43d52000ffe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6068, "upload_time": "2015-12-18T01:47:04", "url": "https://files.pythonhosted.org/packages/e0/1e/461ea1a9a391a6bf10b01467e86c5c68104446e833a1387c103c951da7eb/angelic-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "41eda32fae6236177df102db21593d51", "sha256": "0487230fa8177a911369424dfe4335dbb0ee3e4c9678445a660af18e0e7a0600" }, "downloads": -1, "filename": "angelic-0.1.1.tar.gz", "has_sig": false, "md5_digest": "41eda32fae6236177df102db21593d51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8246, "upload_time": "2015-12-18T07:32:56", "url": "https://files.pythonhosted.org/packages/2d/1a/628bc95229911cb7082e3fe459e56f5f04f36f4b83c37a74adc31d809d15/angelic-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "b5d82b50c2719c148fb457b077422c4f", "sha256": "cd04ca528d09b4213ebc5e25026ff533faa1954820b5298141d1771c3cf2689a" }, "downloads": -1, "filename": "angelic-0.1.2.tar.gz", "has_sig": false, "md5_digest": "b5d82b50c2719c148fb457b077422c4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8316, "upload_time": "2015-12-18T07:40:21", "url": "https://files.pythonhosted.org/packages/ab/de/215f7923527760f1cd83dd366b6f3dc79475b89a4523dd54b0c97f6284bb/angelic-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "4385b40fb0ebb2ce99881b250630438d", "sha256": "e7a49e2a69d5ebda65c33f71f85e47700f9afb02d66d09388bc89388d99ca9ff" }, "downloads": -1, "filename": "angelic-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4385b40fb0ebb2ce99881b250630438d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8293, "upload_time": "2018-07-21T08:01:46", "url": "https://files.pythonhosted.org/packages/b8/20/109859cd0f4b60471c7472755ca6c45cef841f1be3a968926bc623cba823/angelic-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4385b40fb0ebb2ce99881b250630438d", "sha256": "e7a49e2a69d5ebda65c33f71f85e47700f9afb02d66d09388bc89388d99ca9ff" }, "downloads": -1, "filename": "angelic-0.1.3.tar.gz", "has_sig": false, "md5_digest": "4385b40fb0ebb2ce99881b250630438d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8293, "upload_time": "2018-07-21T08:01:46", "url": "https://files.pythonhosted.org/packages/b8/20/109859cd0f4b60471c7472755ca6c45cef841f1be3a968926bc623cba823/angelic-0.1.3.tar.gz" } ] }