I'm trying to modify an XML attribute every time my program starts.
Basically, I'm creating a GUI with PyGObject, and I want the version number in the about box to automatically update.
The XML is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<!-- interface-requires gtk+ 3.6 -->
<object class="GtkAboutDialog" id="aboutDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="title" translatable="yes">About NetGUI</property>
<property name="modal">True</property>
<property name="type_hint">dialog</property>
<property name="program_name">NetGUI</property>
<property name="version">0.5</property>
<property name="copyright" translatable="yes">Copyright (c) 2013. Cody Dostal </property>
<property name="comments" translatable="yes">NetGUI is a GUI frontend to NetCTL, a network manager developed for Arch Linux.</property>
<property name="website">https://github.com/codywd/NetGUI</property>
<property name="website_label" translatable="yes">GitHub</property>
...
How could I automatically edit the Version line to read a variable and change to it?
I have a progVer (program version) variable that it would use. Therefore, I would only increment progVer and it would automatically increment the XML file. If possible, I would like to avoid adding dependencies.
My problem is as follows: My program has a variable that states the program version (progVer is the variable, 0.3 at the moment). I have an external XML file (UI.glade) that holds my about box code. The XML has a property name for version, which I have to manually change to keep about box version with the program version. I want the XML file to automatically update to the newest version, as stated by progVer. I'm not sure how exactly to go about this.