{ "info": { "author": "Laurent Bachelier", "author_email": "laurent@bachelier.name", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7" ], "description": "=======\nconfman\n=======\n\nDescription\n-----------\n\nSynchronize configuration files between machines, lazily, without root permissions,\nand still be able to create powerful rules when needed.\n\nWhile it is mainly targeted at managing personal configuration files (dotfiles),\nit can be used to deploy files to pretty much anything.\n\nIt is designed to have almost no dependencies, and is contained in one small file.\n\nBy default, it will create symbolic links in the destination directory to the files\nin the source directory.\nHowever, some filenames can indicate special actions instead (see below).\n\n\nRequirements\n------------\n\nPython 2.6 or later (for 2.5, try v0.1).\nNo installation needed, though you can install it.\n\n\nUsage\n-----\nThe project is usable, but has no CLI interface for now.\nExamples are available in ``example.py`` and in the public-dotfiles repository.\n\nA simple example:\n\n::\n\n from confman import ConfigSource\n c = ConfigSource(\"~/dotfiles\", \"~\")\n c.sync()\n\n\nSpecial actions\n---------------\n\n* Files with names starting with ``_`` will be ignored.\n This is useful to provide data for programmable actions.\n* File with names ending with ``.copy`` will be a copy.\n It will update the destination file every time.\n* File with names ending with ``.copyonce`` will be a copy.\n It will not update the destination file if either file is modified.\n* Files with names ending with ``.empty`` will be an empty file.\n It will not update the destination file if either file is modified.\n* Files with names ending with ``.p.py`` are programmable actions.\n They contain Python code, and are provided with some special methods.\n* Files with names ending with ``.F`` are normal files.\n It means ``blah.p.py.F`` will end up as ``blah.p.py``,\n and ``f.F.F`` as ``f.F``. It is really useful to make a symbolic link of\n a directory instead of all its children (effectively treating\n the directory as a file).\n\nAll the matching parts of the special actions are removed; ``myfile.empty`` will create\nan empty file named ``myfile``.\n\nProgrammable actions\n--------------------\n\nProgrammable actions can do everything special actions can do, and more.\nThey have to raise a \"Forwarder\", however for most uses helpers are provided to\nkeep the code short.\n\n* ``empty()`` raises an empty action.\n* ``ignore()`` raises an ignore action.\n* ``redirect(filename)`` will create a symbolic link to the provided filename with a ``_`` added.\n ``redirect('myfile')`` will create a symbolic link to ``_myfile``.\n\n\nText / Templates\n~~~~~~~~~~~~~~~~\n\nBoth ``text()`` and ``template()`` use ``string.Template`` templates.\n\n* ``text(data)`` will put the text from the data variable in the destination file.\n* ``template(filename)`` acts like ``text()`` but takes the data from a file.\n\nThey have to be used in two steps:\n\n::\n\n text('hello $name').render(hello='laurentb')\n\nA ``warning`` variable is provided, to help prevent users from modifying\nautomatically generated files.\n\n::\n\n text('''# $warning\n aaa=$var''').render(var='123')\n\nWill output:\n\n::\n\n # WARNING: Do not edit this file, edit the template instead.\n aaa=123\n\nSince it is Python, you can use external libraries if you want,\nincluding advanced template libraries like ``mako``.\n\n\nOptions variable\n~~~~~~~~~~~~~~~~\n\nYou can provide an ``options`` variable to ``confman``, which will be provided\nto the programmable actions.\n\n::\n\n from confman import ConfigSource\n c = ConfigSource(\"~/dotfiles\", \"~\", options={'hostname': 'myhostname'})\n c.sync()\n\nA programmable action could use it like this:\n\n::\n\n if options['hostname'] == 'myhostname':\n redirect('myfile')\n else:\n ignore()\n\n\nThe ``options`` variable does not have to be a ``dict``, it can be anything you want.\n\n\nAdvanced use\n------------\n\nTo debug what is happening (and why), you can do:\n\n::\n\n from confman import ConfigSource\n c.sync()\n print repr(c)\n\n\nChanging the default behavior\n-----------------------------\n\nAll special actions are optional, and can be configured or subclassed.\nFor example, you could change the matching of \"copy\" actions:\n\n::\n\n import confman, re\n # use .COPY instead of .copy\n confman.CopyAction.MATCHED = re.compile(r\"\\.COPY$\")\n # use hg instead of git\n confman.IgnoreAction.MATCHED = re.compile(r\"_|\\.hg|\\.hgignore\")\n\nYou can also change what classes are used.\nBy default, it is ``confman.ConfigSource.DEFAULT_CLASSES``.\n\n::\n\n import confman\n confman.ConfigSource(\"~/dotfiles\", \"~\", classes=[MyClass, confman.SymlinkAction])\n\n\nDevelopment\n-----------\n\nContributions can be sent in the form of git patches, to laurent@bachelier.name.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://git.p.engu.in/laurentb/confman/", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "confman", "package_url": "https://pypi.org/project/confman/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/confman/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://git.p.engu.in/laurentb/confman/" }, "release_url": "https://pypi.org/project/confman/0.2.0/", "requires_dist": null, "requires_python": null, "summary": "Lazy, rootless, yet powerful config file management mostly using symlinks", "version": "0.2.0" }, "last_serial": 1199135, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "98059399b72d80007f28d80dd68e1e80", "sha256": "9a7e062f5d49fe7fa358168c5bc4c7772094d4d931ac36fb260fa58bbca80408" }, "downloads": -1, "filename": "confman-0.1.tar.gz", "has_sig": false, "md5_digest": "98059399b72d80007f28d80dd68e1e80", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8462, "upload_time": "2013-03-04T00:23:54", "url": "https://files.pythonhosted.org/packages/4d/c0/57e7af36d0431db6224d374849a206835133a0fcd3165f180fd2a0be063a/confman-0.1.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "f074628dcb3c4f299ba9e4d2c4260851", "sha256": "945581e20826c0e34733bc372edb29deecce44cb8026e874e722d20d0c9c7b01" }, "downloads": -1, "filename": "confman-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f074628dcb3c4f299ba9e4d2c4260851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8611, "upload_time": "2014-08-22T18:33:41", "url": "https://files.pythonhosted.org/packages/45/4b/6c8fcafc60ecd42fb477ebd55977a0996f7d69d671aee563b73da1992022/confman-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f074628dcb3c4f299ba9e4d2c4260851", "sha256": "945581e20826c0e34733bc372edb29deecce44cb8026e874e722d20d0c9c7b01" }, "downloads": -1, "filename": "confman-0.2.0.tar.gz", "has_sig": false, "md5_digest": "f074628dcb3c4f299ba9e4d2c4260851", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8611, "upload_time": "2014-08-22T18:33:41", "url": "https://files.pythonhosted.org/packages/45/4b/6c8fcafc60ecd42fb477ebd55977a0996f7d69d671aee563b73da1992022/confman-0.2.0.tar.gz" } ] }