{ "info": { "author": "panjy", "author_email": "panjunyong@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "================================================\nFRS = File Repository System \u6587\u4ef6\u5e93\u7cfb\u7edf\n================================================\nfrs.core is a pure python package for a simple file repository system(FRS). \nFRS use a virtual file system which map to the physical disk using a \nconfiguration file. FRS support trash box, metadata and attachments storge,\ncaching and more.\n\n\u505a\u4ec0\u4e48\n===============\n1. \u5b9a\u4e49\u4e86\u4e00\u5957\u865a\u62df\u7684\u6587\u4ef6\u8def\u5f84\u7cfb\u7edf\uff0c\u53ef\u548c\u5b9e\u9645\u7684\u5b58\u50a8\u8def\u5f84\u6620\u5c04\uff0c\u907f\u514d\u76f4\u63a5\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u6587\u4ef6\u7cfb\u7edf\u6253\u4ea4\u9053\n#. \u652f\u6301\u7248\u672c\u7ba1\u7406\uff0c\u53ef\u5b58\u50a8\u6587\u4ef6\u7684\u5386\u53f2\u7248\u672c\u3002\u5b58\u653e\u5230(.frs\u76ee\u5f55\u4e2d)\n#. \u652f\u6301\u7f13\u5b58\uff0f\u6570\u636e\u8f6c\u6362\uff0c\u6bd4\u5982\u56fe\u7247\u7684\u5404\u79cd\u5927\u5c0f\u7684 \u683c\u5f0f\u8f6c\u6362\u548c\u5b58\u50a8\uff0cword\u6587\u4ef6\u7684html\u9884\u89c8\u8f6c\u6362\u548c\u5b58\u50a8\n#. \u652f\u6301\u5783\u573e\u7bb1\uff0c\u5220\u9664\u7684\u6587\u4ef6\u53ef\u81ea\u52a8\u5b58\u653e\u5728\u5783\u573e\u7bb1\u91cc\u9762\n#. \u4e09\u7ea7\u76ee\u5f55\u6620\u5c04\n\n - \u7f51\u7ad9 (zpath) -> FRS (vpath)\n - FRS (vpath) -> ospath (path)\n\n\u51c6\u5907\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u6587\u4ef6\n=========================\n\u627e\u5230\u4e34\u65f6\u6587\u4ef6\u5939: /tmp/frs\n\n >>> import os, tempfile, shutil\n >>> temp_dir = tempfile.gettempdir() + '/frs'\n >>> if os.path.exists(temp_dir):\n ... shutil.rmtree(temp_dir)\n >>> os.mkdir(temp_dir)\n\n\u521b\u5efa\u7f13\u5b58\u6587\u4ef6\u5939: /tmp/frscache\n\n >>> cache = temp_dir + '/frscache'\n >>> os.mkdir(cache)\n\n\u521b\u5efa\u6587\u4ef6\u5939\u7ed3\u6784::\n\n /tmp/frs/d1/f11\n /tmp/frs/lala/d2/d21\n /tmp/frs/lala/d2/f21\n\n >>> d1 = temp_dir + '/d1'\n >>> os.mkdir(d1)\n >>> f11 = d1 + '/f11'\n >>> open(f11, 'w').write('hello')\n >>> lala = temp_dir + '/lala'\n >>> os.mkdir(lala)\n >>> d2 = lala + '/d2'\n >>> os.mkdir(d2)\n >>> f21 = d2 + '/f21'\n >>> open(f21, 'w').write('hello')\n >>> d21 = d2 + '/d21'\n >>> os.mkdir(d21)\n\n\n\u521d\u59cb\u5316\n===================\n\u5f97\u5230\u4e00\u4e2a:\n\n >>> frs_root = FRS()\n\n\u4ec0\u4e48\u90fd\u6ca1\u6709\uff1a\n\n >>> frs_root.listdir('/')\n []\n \nNow we can mount some paths to the top folders:\n \n >>> frs_root.mount('d1', d1)\n >>> frs_root.mount('d2', d2)\n\n\u540c\u65f6\u8bbe\u7f6e\u7f13\u5b58\u76ee\u5f55\n\n >>> frs_root.setCacheRoot(cache)\n\n\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u521d\u59cb\u5316\n=========================\n\u4e0a\u9762\u5f88\u9ebb\u70e6\uff0c\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u66f4\u7b80\u5355\n\n\u914d\u7f6e\u6587\u4ef6::\n\n >>> config = \"\"\"\n ... [cache]\n ... path = /tmp/frscache\n ...\n ... [root]\n ... aa = /tmp/a\n ... bb = /tmp/b\n ...\n ... [site]\n ... / = /aa\n ... \"\"\"\n\n\u52a0\u8f7d::\n\n >>> from zopen.frs import loadFRSFromConfig\n >>> frs_root = loadFRSFromConfig(config)\n\n\u57fa\u672c\u7684\u6587\u4ef6\u7cfb\u7edf\u529f\u80fd\n======================\n\n >>> sorted(frs_root.listdir('/'))\n ['d1', 'd2']\n >>> frs_root.isdir('/d1')\n True\n >>> frs_root.listdir('/d1')\n ['f11']\n >>> frs_root.isdir('/d1/f1')\n False\n >>> sorted(frs_root.listdir('/d2'))\n ['d21', 'f21']\n >>> frs_root.open('/d2/f21').read()\n 'hello'\n\n\u73b0\u5728\u8fd8\u4e0d\u80fd\u8de8\u533a\u79fb\u52a8!\n\n >>> frs_root.move('/d2/f21', '/d1')\n Traceback (most recent call last):\n ...\n Exception: ...\n\n\n\u81ea\u52a8\u6620\u5c04\n==================\n\u5176\u5b9e\u914d\u7f6e\u6587\u4ef6\u4e2d\u53ef\u4ee5\u5728site\u680f\u76ee\u4e2d\u914d\u7f6e\u7684\u3002\n\n\u4e5f\u53ef\u4ee5\u624b\u5de5\u914d\u7f6e:\n\n >>> frs_root.mapSitepath2Vpath(u'/site1/members', u'/d2')\n >>> frs_root.mapSitepath2Vpath(u'/site2/members', u'/d2')\n >>> frs_root.mapSitepath2Vpath(u'/', u'/d1')\n\n\u6211\u4eec\u770b\u770b\u6839\u636e\u7ad9\u70b9\u8def\u5f84\u81ea\u52a8\u8ba1\u7b97\u7684\u8def\u5f84:\n\n >>> frs_root.sitepath2Vpath('/58080_1/zopen/project/1222/files/uncategoried/aaa.doc')\n u'/d1/58080_1/zopen/project/1222/files/uncategoried/aaa.doc'\n\n2\u4e2a\u7ad9\u70b9\u53ef\u4ee5\u6307\u5411\u540c\u4e00\u6587\u4ef6\u7684:\n\n >>> frs_root.sitepath2Vpath('/site1/members/aaa.doc')\n u'/d2/aaa.doc'\n >>> frs_root.sitepath2Vpath('/site2/members/aaa.doc')\n u'/d2/aaa.doc'", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.zopen.cn/zopen.frs", "keywords": "zope3 z3c rpc server client operation", "license": "Private", "maintainer": null, "maintainer_email": null, "name": "zopen.frs", "package_url": "https://pypi.org/project/zopen.frs/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zopen.frs/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.zopen.cn/zopen.frs" }, "release_url": "https://pypi.org/project/zopen.frs/1.2.2/", "requires_dist": null, "requires_python": null, "summary": "zopen frs management", "version": "1.2.2" }, "last_serial": 1525460, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "58c55976ee4eb8564fb78348708d3844", "sha256": "a5e2f203b2add862cab88ac7d6faf673968b5d44268bca763bdd7d8d23ec5112" }, "downloads": -1, "filename": "zopen.frs-1.0.tar.gz", "has_sig": false, "md5_digest": "58c55976ee4eb8564fb78348708d3844", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10146, "upload_time": "2014-01-26T01:22:05", "url": "https://files.pythonhosted.org/packages/c0/1f/5f0766322a99071866010c89fe3b93fac703f81ca0f8c36a98bdbfa89f44/zopen.frs-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "1474e1ef341e0a588d58b481586c18b7", "sha256": "51a5b13ae585cb3cc227046d22d91da2d868373e4b0e4e61c58ba220780f3e4c" }, "downloads": -1, "filename": "zopen.frs-1.1.tar.gz", "has_sig": false, "md5_digest": "1474e1ef341e0a588d58b481586c18b7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8547, "upload_time": "2014-05-12T05:40:44", "url": "https://files.pythonhosted.org/packages/da/1e/d478d5b49613410f692035f2e37bbacb68c918b28b596434987ac3cd3361/zopen.frs-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "fad63395beab3f562eb04bf045dc1187", "sha256": "de765aee29e360c49bf7b417070eb0f9a5c33b79ee2da4462805038ecbdd52da" }, "downloads": -1, "filename": "zopen.frs-1.2.tar.gz", "has_sig": false, "md5_digest": "fad63395beab3f562eb04bf045dc1187", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8561, "upload_time": "2014-09-17T02:28:54", "url": "https://files.pythonhosted.org/packages/5e/d1/b56cd6ebd859f721b5a96575b87dedb1f7faaee81810492136c99c13e2e5/zopen.frs-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "d1c77e779f054c1517b2f3f9651b841f", "sha256": "1b6f5bcf74b0155221f98e2d24e1cb04ca56b09fbd30aabc6a890aaf5d6288c3" }, "downloads": -1, "filename": "zopen.frs-1.2.1.tar.gz", "has_sig": false, "md5_digest": "d1c77e779f054c1517b2f3f9651b841f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8930, "upload_time": "2014-09-17T02:50:45", "url": "https://files.pythonhosted.org/packages/e2/02/ee775c22801a8ce8153bc94ad7b04edf3e390fa3d9597044059e36a94cfa/zopen.frs-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "6a8f8a82ffa94811899b7b6719de2099", "sha256": "7b5be1fd56e67a2a1f79239ac89af9394c0362d94dfce5f585a62bb8fdee4ba2" }, "downloads": -1, "filename": "zopen.frs-1.2.2.tar.gz", "has_sig": false, "md5_digest": "6a8f8a82ffa94811899b7b6719de2099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8960, "upload_time": "2015-04-29T03:51:43", "url": "https://files.pythonhosted.org/packages/09/e9/70cc88abdeda4ad166406fbb6b9f49efa9102b44118e6bff3835b1285785/zopen.frs-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6a8f8a82ffa94811899b7b6719de2099", "sha256": "7b5be1fd56e67a2a1f79239ac89af9394c0362d94dfce5f585a62bb8fdee4ba2" }, "downloads": -1, "filename": "zopen.frs-1.2.2.tar.gz", "has_sig": false, "md5_digest": "6a8f8a82ffa94811899b7b6719de2099", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8960, "upload_time": "2015-04-29T03:51:43", "url": "https://files.pythonhosted.org/packages/09/e9/70cc88abdeda4ad166406fbb6b9f49efa9102b44118e6bff3835b1285785/zopen.frs-1.2.2.tar.gz" } ] }