{ "info": { "author": "Christian Zagrodnick", "author_email": "cz@gocept.com", "bugtrack_url": null, "classifiers": [], "description": "=========\nFilestore\n=========\n\nThe filestore is an easy way to to process files with multiple processes\nwithout needing locks.\n\n\nInitialize a FileStore\n======================\n\nCreate a filestore in a temporary area:\n\n>>> import tempfile\n>>> store_dir = tempfile.mkdtemp()\n>>> from gocept.filestore import FileStore\n>>> filestore = FileStore(store_dir)\n>>> filestore\n\n\nSo far nothing has happend:\n\n>>> import os\n>>> os.listdir(store_dir)\n[]\n\nBefore using the store we need to prepare it:\n\n>>> filestore.prepare()\n\nPrepare has created the tmp/new/cur directory structure:\n\n>>> sorted(os.listdir(store_dir))\n['cur', 'new', 'tmp']\n\nCalling prepare again does nothing:\n\n>>> filestore.prepare()\n>>> sorted(os.listdir(store_dir))\n['cur', 'new', 'tmp']\n\n\nUse a FileStore\n===============\n\nAdding files to the store works with the `create` method:\n\n>>> f = filestore.create('a-file')\n\nFiles are created in the 'tmp' area with the 'w' mode (if not specified):\n\n>>> f\n\n\nWe find the file in the tmp area. Note that `filestore.list` lists files with\ntheir full path names, so we could feed the name directly to file/open:\n\n>>> filestore.list('tmp')\n['.../tmp/a-file']\n\nWe got a plain file back, so write to it:\n\n>>> f.write('Die Ente bleibt draussen!')\n>>> f.close()\n\nWe have finished writing our file, so we can move it to the `new` space for\nother applications to pick it up:\n\n>>> filestore.move('a-file', 'tmp', 'new')\n>>> filestore.list('tmp')\n[]\n>>> filestore.list('new')\n['.../new/a-file']\n\nThe move operation uses os.move which is supposed to be atomic. When another\nprocesses \"sees\" the file it can directly work with it and move it to 'cur':\n\n>>> filestore.move('a-file', 'new', 'cur')\n>>> filestore.list('new')\n[]\n>>> filestore.list('cur')\n['.../cur/a-file']\n\nFiles can be copied, too:\n\n>>> filestore.copy('a-file', 'cur', 'tmp')\n>>> filestore.list('cur')\n['.../cur/a-file']\n>>> filestore.list('tmp')\n['.../tmp/a-file']\n\n\nCleanup\n=======\n\nRemove the temporary directory after testing:\n\n>>> import shutil\n>>> shutil.rmtree(store_dir)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/gocept.filestore", "keywords": null, "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "gocept.filestore", "package_url": "https://pypi.org/project/gocept.filestore/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/gocept.filestore/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/gocept.filestore" }, "release_url": "https://pypi.org/project/gocept.filestore/0.3/", "requires_dist": null, "requires_python": null, "summary": "Provides maildir like access to files", "version": "0.3" }, "last_serial": 792554, "releases": { "0.2": [ { "comment_text": "", "digests": { "md5": "9ffc895c96d1f090dcfd75d4c0d220e6", "sha256": "b4aa426dc7ceca6924f149578fb2bdc7336e0c469b6bc6dd9cbfb2539d21744c" }, "downloads": -1, "filename": "gocept.filestore-0.2.tar.gz", "has_sig": true, "md5_digest": "9ffc895c96d1f090dcfd75d4c0d220e6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4287, "upload_time": "2007-08-30T16:28:37", "url": "https://files.pythonhosted.org/packages/fc/03/b3723903fddd9d8d75d7ecc8c2a258624646f70e69ea01ae1aab57676cc1/gocept.filestore-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "e979329793f8bd58fafa1a03c0f9a855", "sha256": "2722834c0d6cf7124b021970bc780d37d60a8664822f3935dfdfcf66a0bff648" }, "downloads": -1, "filename": "gocept.filestore-0.3.tar.gz", "has_sig": false, "md5_digest": "e979329793f8bd58fafa1a03c0f9a855", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4470, "upload_time": "2009-10-08T15:13:10", "url": "https://files.pythonhosted.org/packages/74/59/62c2228cfacac302771b8701f229df8a6f7cf5646b2d94c1b8739c246617/gocept.filestore-0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e979329793f8bd58fafa1a03c0f9a855", "sha256": "2722834c0d6cf7124b021970bc780d37d60a8664822f3935dfdfcf66a0bff648" }, "downloads": -1, "filename": "gocept.filestore-0.3.tar.gz", "has_sig": false, "md5_digest": "e979329793f8bd58fafa1a03c0f9a855", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4470, "upload_time": "2009-10-08T15:13:10", "url": "https://files.pythonhosted.org/packages/74/59/62c2228cfacac302771b8701f229df8a6f7cf5646b2d94c1b8739c246617/gocept.filestore-0.3.tar.gz" } ] }