Tree @master (Download .tar.gz)
Debmutate is a set of Python modules for manipulating the control files of Debian packages, with the ability to preserve the existing formatting of the control files.
To modify one of the control files, use one of the context managers to edit the file:
from debmutate.control import ControlEditor with ControlEditor(path='debian/control') as control: print(control.source['Maintainer']) control.source['Maintainer'] = "Jelmer Vernooĳ <email@example.com>"
Once you leave the context manager, the changes will be written to disk if there were any. If the editor is unable to preserve the formatting of the control file, it will raise a FormattingUnpreservable error. The file will be left as-is if an exception is raised, or if the .cancel() method is called.
If the control file that was edited was generated from another control file (e.g. debian/control.in), debmutate will attempt to update that file instead and then regenerate debian/control. If it is unable to do so, it will raise a GeneratedFile exception.
debmutate currently provides editors for the following control files:
git clone https://www.jelmer.uk/code/debmutate/
- Update one more version number. Jelmer Vernooĳ 21 days ago
- releasing package debmutate version 0.10 Jelmer Vernooĳ 21 days ago
- Fix Python version number. Jelmer Vernooĳ 21 days ago
- Fix tests. Jelmer Vernooĳ a month ago
- Update changelog. Jelmer Vernooĳ a month ago
- Add methods for accessing options on Watch. Jelmer Vernooĳ a month ago
- releasing package debmutate version 0.8 Jelmer Vernooĳ a month ago
- Suppress warnings about substvars. Jelmer Vernooĳ a month ago
- Add support for parsing maintscript files. Jelmer Vernooĳ a month ago
- releasing package debmutate version 0.7 Jelmer Vernooĳ a month ago