cofman

COnfig File MANipluation library
Download

cofman Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Freely Distributable
  • Price:
  • FREE
  • Publisher Name:
  • James William Pye
  • Publisher web site:
  • http://python.projects.postgresql.org/

cofman Tags


cofman Description

cofman is a Python module to manipulate simple configuration files in a, relatively, intelligent fashion.Given a simple configuration file, cofman.lib provides a means to edit the file using a dictionary-like interface:import cofman.libconfig = cofman.lib.File("/etc/sysctl.conf")>>> config"1"# given permission =)>>> config = "100""100"Every dictionary operation reads from the file, so using this as a cache is not appropriate. Usually, only the cofman.lib.File.update and cofman.lib.File.getset methods should be used to interact with the configuration. The other operations are provided for convenience.By default, the configuration file is assumed to use the following delimiters:config = { 'quote': "'", 'quote_escape': "''", 'comment': "#", 'assignment': '=', 'record': '\n',}WarningThe value side of the settings are unconditionally quoted when modified.Considerationscofman was not written with performance in mind. It is designed for common case editing that does not occur often enough to warrant heavy optimizations.Product's homepage


cofman Related Software