Giter Site home page Giter Site logo

pombredanne / python-update-dotdee Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xolox/python-update-dotdee

0.0 2.0 0.0 176 KB

Generic modularized configuration file manager

Home Page: https://pypi.python.org/pypi/update-dotdee

License: MIT License

Makefile 5.48% Python 94.52%

python-update-dotdee's Introduction

update-dotdee: Generic modularized configuration file manager

The update-dotdee program makes it very easy to manage (configuration) files with modular contents in the style of Debian and dotdee. The program takes the pathname of an existing file and updates that file based on the contents of the files in the directory with the same name as the file but ending in .d. For example:

peter@macbook> sudo update-dotdee /etc/hosts
2013-07-06 19:32:03 macbook INFO Reading file: /etc/hosts.d/1-local
2013-07-06 19:32:03 macbook INFO Reading file: /etc/hosts.d/2-work
2013-07-06 19:32:03 macbook INFO Reading file: /etc/hosts.d/3-ipv6
2013-07-06 20:59:24 macbook INFO Checking for local changes to /etc/hosts
2013-07-06 19:32:03 macbook INFO Writing file: /etc/hosts

Some notes about how it works:

  • If the given file exists but the corresponding directory does not exist yet, the directory is created and the file is moved into the directory (and renamed to local) so that its existing contents are preserved.
  • If the generated file has been modified since the last run, update-dotdee will refuse to overwrite its contents (unless you use the --force option).
  • The files in the .d directory are concatenated in the natural sorting order of the filenames (as implemented by the naturalsort package).

Installation

You can install the update-dotdee program using the following command:

pip install update-dotdee

Contact

The latest version of update-dotdee is available on PyPi and GitHub. For bug reports please create an issue on GitHub. If you have questions, suggestions, etc. feel free to send me an e-mail at [email protected].

License

This software is licensed under the MIT license.

© 2013 Peter Odding.

python-update-dotdee's People

Contributors

xolox avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.