{ "info": { "author": "Yijun Zhu", "author_email": "peter_zyj@hotmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "|Build\\_Status|\n|Coverage\\_Status|\n\n========\nOverview\n========\n\n*Yinotify* help user to create the callback function triggered when the monitor event detected by the linux Kernel. User could register the directoried for the watching and bing with the Event with the specified action. Internal Class Yivent could help to collect the statistics and status based on the events registered. That polling one or more directories to determine if anything has changed is the linux kernel interface, which help us control more from application level \n\nthe project based on inotify, and removed some unused function and class\n\n\n\n==========\nInstalling\n==========\n\nInstall via *pip*::\n\n $ sudo pip install Yinotify\n\n\n=======\nExample\n=======\n\nSimple Usage::\n\n exp1:\n def printEvent():\n print(\"Action triggered!!\")\n\n yiSample = Yinotify.fEvent(_target_folder,\"IN_ISDIR\",printEvent)\n\n exp2:\n def printEvent(arg):\n print(\"Action triggered!!\",arg)\n\n yiSample = Yinotify.fEvent(_target_folder,\"IN_ISDIR\",printEvent,action_args=(\"arg1\",))\n\n=========\nUnit Test\n=========\n\nPytest Example::\n\n def printEvent(timeSlot,case):\n global result\n duration = time.time() - timeSlot\n print(\"%s:::Action1 triggered!!\"%(duration))\n result[case] = True\n return\n\n def printEvent2(case):\n global result\n print(\"Action2 triggered!!\")\n result[case] = True\n return\n\n def printEvent3():\n global result\n print(\"Action3 triggered!!\")\n result[\"test_events_IN_MOVED\"] = True\n return\n\n\n def test_events_IN_ISDIR():\n result[\"test_events_IN_ISDIR\"] = False\n test1 = Yinotify.Yivent(folder,\"IN_ISDIR\",printEvent2,action_args=(\"test_events_IN_ISDIR\",))\n cmd = \"ls %s/\" % (folder)\n print(\"test_events_IN_ISDIR::\"+cmd)\n os.popen(cmd)\n n = 0\n while n < 2:\n time.sleep(1)\n n += 1\n del test1\n assert result[\"test_events_IN_ISDIR\"] == True\n print(\"--------------------------------------------------------\")\n\n def test_events_IN_OPEN():\n result[\"test_events_IN_OPEN\"] = False\n timeSlot = time.time()\n test2 = Yinotify.Yivent(folder,\"IN_OPEN\",printEvent,action_args=(timeSlot,\"test_events_IN_OPEN\"))\n cmd = \"touch %s/Yijun2\" % (folder)\n print(\"test_events_IN_OPEN::\"+cmd)\n os.popen(cmd)\n n = 0\n while n < 2:\n time.sleep(1)\n n += 1\n del test2\n\n assert result[\"test_events_IN_OPEN\"] == True\n print(\"--------------------------------------------------------\")\n\n\n def test_events_IN_MOVED():\n result[\"test_events_IN_MOVED\"] = False\n test3 = Yinotify.Yivent(folder,\"IN_MOVED_FROM,IN_MOVED_TO\",printEvent3)\n cmd = \"mv %s/Yijun2 %s/Yijun22\" % (folder,folder)\n print(\"test_events_IN_MOVED::\"+cmd)\n os.popen(cmd)\n n = 0\n while n < 2:\n time.sleep(1)\n n += 1\n del test3\n assert result[\"test_events_IN_MOVED\"] == True\n print(\"--------------------------------------------------------\")\n\n\n\n def test_events_IN_CREATE():\n result[\"test_events_IN_CREATE\"] = False\n timeSlot = time.time()\n test4 = Yinotify.Yivent(folder,\"IN_CREATE\",printEvent,action_args=(timeSlot,\"test_events_IN_CREATE\"))\n os.mkdir(folder+'/Yijun3')\n print(\"test_events_IN_CREATE::os.mkdir(folder+'/Yijun3')\")\n\n n = 0\n while n < 2:\n time.sleep(1)\n n += 1\n del test4\n\n assert result[\"test_events_IN_CREATE\"] == True\n print(\"--------------------------------------------------------\")\n\n def test_events_IN_DELETE():\n result[\"test_events_IN_DELETE\"] = False\n timeSlot = time.time()\n test5 = Yinotify.Yivent(folder,\"IN_DELETE\",printEvent,action_args=(timeSlot,\"test_events_IN_DELETE\"))\n os.remove(folder+\"/Yijun22\")\n os.rmdir(folder+\"/Yijun3\")\n print(\"test_events_IN_DELETE::os.remove(folder+'/Yijun2')\")\n\n n = 0\n while n < 2:\n time.sleep(1)\n n += 1\n del test5\n\n assert result[\"test_events_IN_DELETE\"] == True\n print(\"--------------------------------------------------------\")\n\n\n.. |Build_Status| image:: https://api.travis-ci.org/peter-zyj/Yinotify.svg?branch=master\n :target: https://travis-ci.org/peter-zyj/Yinotify\n.. |Coverage_Status| image:: https://coveralls.io/repos/github/peter-zyj/Yinotify/badge.svg?branch=master\n :target: https://coveralls.io/github/peter-zyj/Yinotify?branch=master", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/peter-zyj/Yinotify", "keywords": "Yinotify", "license": "GPL 2", "maintainer": "", "maintainer_email": "", "name": "Yinotify", "package_url": "https://pypi.org/project/Yinotify/", "platform": "Linux", "project_url": "https://pypi.org/project/Yinotify/", "project_urls": { "Homepage": "https://github.com/peter-zyj/Yinotify" }, "release_url": "https://pypi.org/project/Yinotify/0.2.14/", "requires_dist": null, "requires_python": "", "summary": "Based on pyinotfy, simplify the module by removing unused class and add new useful function to implement the callback", "version": "0.2.14" }, "last_serial": 3842853, "releases": { "0.2.10": [ { "comment_text": "", "digests": { "md5": "de682942cd4677d8aa7dead0b6dc04b0", "sha256": "131cf4caf16d7bd74476ce8e93fa4439536891654b9373958db1f17600d02030" }, "downloads": -1, "filename": "Yinotify-0.2.10.tar.gz", "has_sig": false, "md5_digest": "de682942cd4677d8aa7dead0b6dc04b0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6257, "upload_time": "2018-05-03T20:48:12", "url": "https://files.pythonhosted.org/packages/8c/cf/61030c80cc3933b3b6f8c2c7da6f4cff9ec99c10997e2efbd1e00be37911/Yinotify-0.2.10.tar.gz" } ], "0.2.11": [ { "comment_text": "", "digests": { "md5": "f5e1205340ff10e23152a526a35edb16", "sha256": "64d5940946bfcdd63a2b6014f971ad373152780f7e104b00abc1162be3d7cb53" }, "downloads": -1, "filename": "Yinotify-0.2.11.tar.gz", "has_sig": false, "md5_digest": "f5e1205340ff10e23152a526a35edb16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6280, "upload_time": "2018-05-03T22:26:59", "url": "https://files.pythonhosted.org/packages/56/9e/6144baa7e92ea39ddec9032bb03b64a8819c3f7674845fcabf7e6f8a5b07/Yinotify-0.2.11.tar.gz" } ], "0.2.12": [ { "comment_text": "", "digests": { "md5": "83f34884074cbfc6724b68c579a8bd9c", "sha256": "93d4905f8e1bfaddd5a717c1e82d88c28f94e2ff4474975c9e71ae9385be539f" }, "downloads": -1, "filename": "Yinotify-0.2.12.tar.gz", "has_sig": false, "md5_digest": "83f34884074cbfc6724b68c579a8bd9c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7534, "upload_time": "2018-05-04T02:20:28", "url": "https://files.pythonhosted.org/packages/d1/3b/a2fb4471fde50c8945ef0bec31c0a7d1db0ba463420d6651b6609f18e9e5/Yinotify-0.2.12.tar.gz" } ], "0.2.13": [ { "comment_text": "", "digests": { "md5": "30a95d491e678e6afb0d77be79c8b9a5", "sha256": "f92947964a4252c444c04f74c4aaf48f23f3a6b71a2eee276738a75c204db991" }, "downloads": -1, "filename": "Yinotify-0.2.13.tar.gz", "has_sig": false, "md5_digest": "30a95d491e678e6afb0d77be79c8b9a5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7537, "upload_time": "2018-05-04T02:39:08", "url": "https://files.pythonhosted.org/packages/c8/fa/28f4689489c0666e17b5cf1df1977eea7d1a405e28573ff8bbdacfe64401/Yinotify-0.2.13.tar.gz" } ], "0.2.14": [ { "comment_text": "", "digests": { "md5": "3876d160557ca97f71a48fcfa6f53ed4", "sha256": "8fd2839083dc26c890f46bb89da358ce60f3a7b20c8838e8e5ce7e16cd20ec78" }, "downloads": -1, "filename": "Yinotify-0.2.14.tar.gz", "has_sig": false, "md5_digest": "3876d160557ca97f71a48fcfa6f53ed4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8239, "upload_time": "2018-05-08T02:43:51", "url": "https://files.pythonhosted.org/packages/3d/68/750dcbbe4ab86f811338c42744e24ad1100fe5e641721289cd792075e0fe/Yinotify-0.2.14.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "3d12229bdb7d12177a9332c798a9e7b3", "sha256": "790309257bd134f6b9be44c35f0b008b14fbbb4fb293b712a5e3e48b3d9ce66b" }, "downloads": -1, "filename": "Yinotify-0.2.4.tar.gz", "has_sig": false, "md5_digest": "3d12229bdb7d12177a9332c798a9e7b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1045, "upload_time": "2018-04-28T00:07:59", "url": "https://files.pythonhosted.org/packages/8e/15/4f20daf64ca7fcc77dd51fbae4c264158e9b18fe4b380c3f2bdb09dc411f/Yinotify-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "605a84b98c5571c4fc9396e7bd535e45", "sha256": "2e966bdd420bd61c56dbdb319e9750a19a97f4d84d68ec08995e20705155d0ec" }, "downloads": -1, "filename": "Yinotify-0.2.5.tar.gz", "has_sig": false, "md5_digest": "605a84b98c5571c4fc9396e7bd535e45", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5929, "upload_time": "2018-04-28T04:08:46", "url": "https://files.pythonhosted.org/packages/6e/02/8055e24461fbc3d642d020c802ecc22d8b5aef286b01a9c7f11ddf157362/Yinotify-0.2.5.tar.gz" } ], "0.2.6": [ { "comment_text": "", "digests": { "md5": "4e7ca3ed832731a0555a898e797087a9", "sha256": "fd689aee3f0d57ddeaa3b9d67374d2007dac233545b7fb4e52d6ad8845ab357f" }, "downloads": -1, "filename": "Yinotify-0.2.6.tar.gz", "has_sig": false, "md5_digest": "4e7ca3ed832731a0555a898e797087a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6292, "upload_time": "2018-04-29T03:23:41", "url": "https://files.pythonhosted.org/packages/18/0f/d02661f014d0a19e4b160ade880d36f9a4e08507b61e3451ef2bd0ba72ff/Yinotify-0.2.6.tar.gz" } ], "0.2.7": [ { "comment_text": "", "digests": { "md5": "acabbaafd78776bb571e674b05fe3e11", "sha256": "71665bde437696e28aa6decbdc481a8e673699aa35a0f3e51f59053b5a2f91ce" }, "downloads": -1, "filename": "Yinotify-0.2.7.tar.gz", "has_sig": false, "md5_digest": "acabbaafd78776bb571e674b05fe3e11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6811, "upload_time": "2018-04-29T03:38:15", "url": "https://files.pythonhosted.org/packages/4f/a4/52174460b3e796fd58971a22e2c03209681eb1351ef611b04a02e838456d/Yinotify-0.2.7.tar.gz" } ], "0.2.8": [ { "comment_text": "", "digests": { "md5": "2d871d40e52b493ee0c33faa7a74d27e", "sha256": "e37b40530dc26abfef063076086c1fa9e5ac747bd414d4b8eb5a6a9607c395c2" }, "downloads": -1, "filename": "Yinotify-0.2.8.tar.gz", "has_sig": false, "md5_digest": "2d871d40e52b493ee0c33faa7a74d27e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5969, "upload_time": "2018-05-02T03:45:32", "url": "https://files.pythonhosted.org/packages/1b/fd/26aff94675c310dda24dd8a41b98595ed7486de1feef1c5ea8837c2a0097/Yinotify-0.2.8.tar.gz" } ], "0.2.9": [ { "comment_text": "", "digests": { "md5": "c945c89f7285b378aea6887a09673bc9", "sha256": "bcf48266b897b16c4a1a9d2f6df50662e8a0268ce92e4ad292556a0d0e246429" }, "downloads": -1, "filename": "Yinotify-0.2.9.tar.gz", "has_sig": false, "md5_digest": "c945c89f7285b378aea6887a09673bc9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5987, "upload_time": "2018-05-03T03:12:58", "url": "https://files.pythonhosted.org/packages/da/bb/c0a88120d38b624eb3ab509a3e022fd12b33dbd849338a971025c9f69ad3/Yinotify-0.2.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3876d160557ca97f71a48fcfa6f53ed4", "sha256": "8fd2839083dc26c890f46bb89da358ce60f3a7b20c8838e8e5ce7e16cd20ec78" }, "downloads": -1, "filename": "Yinotify-0.2.14.tar.gz", "has_sig": false, "md5_digest": "3876d160557ca97f71a48fcfa6f53ed4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8239, "upload_time": "2018-05-08T02:43:51", "url": "https://files.pythonhosted.org/packages/3d/68/750dcbbe4ab86f811338c42744e24ad1100fe5e641721289cd792075e0fe/Yinotify-0.2.14.tar.gz" } ] }