{ "info": { "author": "Kapil Thangavelu", "author_email": "kapil.foss@objectrealms.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Software Development :: Version Control" ], "description": "-------\nore.svn\n-------\n\nOffers an alternative pythonic r/w api to subversion that utilizes the underlying libsvn api,\nand does automatic memory management svn (1.0-1.5), and transaction handling. the major\ndesign goal is to make working with subversion from python fun and easy. Its been in use\nand around since 2002 (svn 0.1x series).\n\nit operates directly on the subversion repository layer, and needs direct filesystem access\nto the repository.\n\nore.svn is licensed under the Apache Public License (2.0)\n\nInstallation\n------------\n\nTo install the package, you must have the python subversion bindings installed. Although ore.svn\nsupports older versions of subversion, the recommended version is the latest release, as they\nall have bug fixes and improvements for the language bindings. Once you have the bindings, to\ninstall this package:\n\n $ easy_install ore.svn\n\nthe library features some basic integration with zope3 for interface declarations and transactions \nand has dependencies on those libraries (zope.interface, transaction) which will be installed\nalongside it.\n\nAPI\n---\n\nSubversionContext \n=================\n \nrepresents access to a node hierarchy within a subversion repository:\n \n >>> from ore.svn import SubversionContext\n >>> ctx = SubversionContext( test_repo_path )\n \nyou can also limit operations it to a particular path within a repository.\nwhich will bind the context to a particular subtree:\n\n >>> another_ctx = SubversionContext( test_repo_path, '/myproject') \n\nto access the svn nodes from the context, we access the root of\nthe node tree on the context:\n\n >>> node = ctx.root\n\nthe path of any node witin the repository is represented by the svn_path attribute.\n\n >>> node.svn_path\n '/'\n\n \nSubversionNode \n==============\n\nrepresents a file or directory within a subversion repository, provides generic property\nhandling and revision history introspection.\n\nrepository revision properties on nodes are accessible via attributes\n\nthe last log message of the revision the node was last modified:\n\n >>> node.last_log # information from the last \n \n\nthe date the node was last modified:\n\n >>> node.modification_time\n datetime.datetime(2004, 3, 27, 18, 1, 4)\n\nthe revision the node was created:\n\n >>> node.revision_created\n 5\n\nthe node's container node:\n\n >>> node.parent_node\n \n\ncustom node properties are accessible via a mutable properties mapping object:\n\n >>> node.properties['svn:externals'] = \"ore.svn https://svn.objectrealms.net/svn/public/ore.svn\"\n\nall nodes have an api for discovering their path ancestry with the corresponding\nrevision information:\n\n >>> file = node['core']['elephants.txt']\n >>> log_entries = file.getMappedLogEntries()\n >>> for entry in log_entries:\n ... print \"Revision and Path\", entry.revision, entry.rev_path \n Revision and Path 4 /core/elephants.txt\n Revision and Path 2 /core/elephants.txt\n Revision and Path 1 /core/elephants.txt\n\nSubversionDirectory\n===================\n\ndirectories use the standard python mapping interface to expose their children:\n\n >>> directory = node # the root is also a directory, alias it for clarity\n >>> directory.keys()\n ['core']\n\nWe can also use the files and directories attributes to access just those types of child nodes.\n\n >>> directory.files\n []\n\nOr see see if a file is contained in a directory by name\n\n >>> \"readme.txt\" in directory\n False\n\n >>> directory = directory['core']\n >>> directory.keys()\n ['elephants.txt', 'resources', 'cats.txt']\n\n >>> file = directory['cats.txt']\n >>> directory.get('nonexistant')\n\nwe copy a node in a directory with the given copy name. \n\n >>> copied_file = directory.copy( \"zebra.txt\", file )\n\nto create a directory, or empty file.\n\n >>> subdirectory = directory.makeDirectory(\"baz\")\n >>> newfile = subdirectory.makeFile(\"bear.txt\")\n \nwe can move a node, from a previous location to a new location via assignment into a\ndirectory.\n\n >>> directory['horses.txt'] = directory['elephants.txt']\n >>> 'elephants.txt' in directory\n False\n\nto delete nodes, the standard mapping api works\n\n >>> del directory['horses.txt']\n\nSubversionFile\n==============\n\nin addition to standard node log inspection, files offer some additional methods, we can\nintrospect the content of a file via accessing the contents attribute.\n\n >>> file.contents\n 'hello world\\nrevision 2\\n\\n'\n\nand write to the file replace the file contents with a string.\n\n >>> file.write(\"old cat new tricks\")\n\nalternatively we could just do assignment to the contents attribute.\n\n >>> file.contents = \"abc\"\n\nfor larger files, we can use a stream api to write the contents\n\n >>> from StringIO import StringIO\n >>> in_stream = StringIO(\"When angry, count ten, before you speak; if very angry, a hundred.\")\n >>> file.writeStream( in_stream )\n\nor to read them.\n\n >>> out_stream = StringIO()\n >>> file.read( writer=out_stream )\n >>> out_stream.getvalue()\n 'When angry, count ten, before you speak; if very angry, a hundred.'\n\nadditional properties, size of the file's contents\n\n >>> file.size\n 66L\n\nthe md5 checksum of the content\n\n >>> file.checksum\n '8c3b9a49408f09648a7b0494af5d88e5'\n\nand its mime type.\n\n >>> file.mime_type\n 'text/plain'\n\nLocation and History\n++++++++++++++++++++\n\nwe can examine the history of any node using a myraid of api calls. getLog returns the log entry \nfor a particular revision, the most recent by default.\n\n >>> file.getLog()\n \n\nwe can also get all the log entries for a node, by invoking getLogEntries.\n \n >>> for i in file.getLogEntries(): print i.date, i.author, i.message,\n 2004-03-27 17:50:49 hazmat moving files\n 2004-03-27 17:50:20 hazmat second commit\n 2004-03-27 17:49:07 hazmat initial import\n\nStreaming\n+++++++++\n \nto stream the contents of a file, provide a stream to the getContents api\n\n >> stream = os.tmpfile()\n >> file.getContents( writer=stream )\n\nto write a stream's contents to the file use the writeStream\n\n >> fh = open('bigfile.pdf')\n >> file.writeStream( fh )\n\nTransactions\n============\n \nore.svn integrates with zope's transaction api for transaction management. transaction\nhandling is automatic, any modification of a node, automatically creates a corresponding\nsubversion transaction. the system does not employ subversion's delta editor api, the nodes\nare modified in place.\n\n >> import transaction\n\n >> transaction.abort() # abort all the modifications we've made so far\n\n >> root.makeDirectory(\"reptiles\")\n >> del root['oldproject']\n >> transaction.commit() # commit our changes\n\nthere is an alternative api for those who prefer, which also exposes setting revision\nproperties.\n\n >> root.makeDirectory(\"mammals\")\n \n\n >> svntxn = ctx.transaction\n\n >> svntxn.author = \"kapil\"\n >> svntxn.message = \"made directory for mammals\"\n\n >> svntxn.commit()\n\nif an access name is set then the author is set on transaction creation to the access name.\n\nLocking\n=======\n\nThe svn locking api, requires setting a username for filesystem access, as locks have associated\nowners. Locks currently are only applicable on files.\n\n >> ctx.setAccess(\"zookeeper\")\n >> file_node = root['horses.txt']\n\nTree Iterators\n==============\n\n provide a quick way to iterate and operate on a subversion directory tree.\n\n >>> from ore.svn.tree import fileIterator, lockTree, unlockTree\n \n print all the path to files in the directory and its children\n\n >>> ctx = SubversionContext( test_repo_path )\n\n\n >>> for file_node in fileIterator( ctx.root ):\n ... print file_node.path\n\n lock and unlock all the files in the directory and its subdirectories (tree).\n\n >>> lockTree( ctx.root, 'lock-token-abc' )\n\n To unlock we need to pass in the same token, or force via the break_locks boolean keyword argument\n\n >>> unlockTree( ctx.root, 'lock-token-abc' )\n\nPropertySheets\n==============\n\ntodo - documentation\n\n\n\n\nChanges\n-------\n\n1.0.5 - 2008/5/5\n\n- update unit tests to no longer require manual intervention to create repository\n\n- turn readme into a real doc test.\n\n- fixes for the tree iterator apis.\n\n1.0.4 - 2008/2/3\n\n- update install_requires, transaction module is now separate from\n the zodb!\n\n0.9.6 - 2006/8/7 \n\n- First Pypi Release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://svn.objectrealms.net/svn/public/ore.svn", "keywords": "zope svn subversion", "license": "http://www.apache.org/licenses/LICENSE-2.0", "maintainer": null, "maintainer_email": null, "name": "ore.svn", "package_url": "https://pypi.org/project/ore.svn/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ore.svn/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://svn.objectrealms.net/svn/public/ore.svn" }, "release_url": "https://pypi.org/project/ore.svn/1.0.5/", "requires_dist": null, "requires_python": null, "summary": "An object oriented api for subversion with support for r/w", "version": "1.0.5" }, "last_serial": 795830, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9907b3d609fd3394ba6730d4db1fe61a", "sha256": "c8c23805b7921c2e383963216ebec9f2440627e5751b81d606b95ffee350bd69" }, "downloads": -1, "filename": "ore.svn-1.0.0.tar.gz", "has_sig": false, "md5_digest": "9907b3d609fd3394ba6730d4db1fe61a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 30142, "upload_time": "2006-11-29T14:03:54", "url": "https://files.pythonhosted.org/packages/52/f6/7f1a2af2f4860cfeb769ef67977f68b0e968ee22740fe17af6b7da7b5389/ore.svn-1.0.0.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "2cc3f45bfedbb0d3b93c5bbf29c6290b", "sha256": "4df8e385e24be82ffdecb8c8939aa6fcdd8a116df1b53899249ee2865a32933d" }, "downloads": -1, "filename": "ore.svn-1.0.5-py2.5.egg", "has_sig": false, "md5_digest": "2cc3f45bfedbb0d3b93c5bbf29c6290b", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 91928, "upload_time": "2008-05-07T19:47:50", "url": "https://files.pythonhosted.org/packages/fc/2f/0393358321b147cd663a641ad39ac21247e35e626d18b2897d5aa747f4a3/ore.svn-1.0.5-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "72f7b3d57ac746d97cf41a88d2c5f07e", "sha256": "944e8626db56aa6740744d84097f78d4a076ea156e151caf46105dd082d3cce2" }, "downloads": -1, "filename": "ore.svn-1.0.5.tar.gz", "has_sig": false, "md5_digest": "72f7b3d57ac746d97cf41a88d2c5f07e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36689, "upload_time": "2008-05-07T19:47:46", "url": "https://files.pythonhosted.org/packages/93/3d/04ae4eb43d8f4de0cdcbd07856e6fd279d2315683bb880a8440822d81ed9/ore.svn-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2cc3f45bfedbb0d3b93c5bbf29c6290b", "sha256": "4df8e385e24be82ffdecb8c8939aa6fcdd8a116df1b53899249ee2865a32933d" }, "downloads": -1, "filename": "ore.svn-1.0.5-py2.5.egg", "has_sig": false, "md5_digest": "2cc3f45bfedbb0d3b93c5bbf29c6290b", "packagetype": "bdist_egg", "python_version": "2.5", "requires_python": null, "size": 91928, "upload_time": "2008-05-07T19:47:50", "url": "https://files.pythonhosted.org/packages/fc/2f/0393358321b147cd663a641ad39ac21247e35e626d18b2897d5aa747f4a3/ore.svn-1.0.5-py2.5.egg" }, { "comment_text": "", "digests": { "md5": "72f7b3d57ac746d97cf41a88d2c5f07e", "sha256": "944e8626db56aa6740744d84097f78d4a076ea156e151caf46105dd082d3cce2" }, "downloads": -1, "filename": "ore.svn-1.0.5.tar.gz", "has_sig": false, "md5_digest": "72f7b3d57ac746d97cf41a88d2c5f07e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36689, "upload_time": "2008-05-07T19:47:46", "url": "https://files.pythonhosted.org/packages/93/3d/04ae4eb43d8f4de0cdcbd07856e6fd279d2315683bb880a8440822d81ed9/ore.svn-1.0.5.tar.gz" } ] }