Adjust for new QubesVmCollection.save() implementation

Watch for MOVED_TO events in /var/lib/qubes directory to reload
qubes.xml.
This commit is contained in:
Marek Marczykowski-Górecki 2013-12-02 04:03:05 +01:00
parent fda7180d16
commit f587ac2d43

View File

@ -85,6 +85,10 @@ class QubesManagerFileWatcher(ProcessEvent):
if event.path == system_path["qubes_store_filename"]: if event.path == system_path["qubes_store_filename"]:
self.update_func() self.update_func()
def process_IN_MOVED_TO (self, event):
if event.pathname == system_path["qubes_store_filename"]:
self.update_func()
def process_IN_CLOSE_WRITE (self, event): def process_IN_CLOSE_WRITE (self, event):
if event.path == qubes_clipboard_info_file: if event.path == qubes_clipboard_info_file:
src_info_file = open (qubes_clipboard_info_file, 'r') src_info_file = open (qubes_clipboard_info_file, 'r')
@ -2223,6 +2227,7 @@ def main():
notifier = ThreadedNotifier(wm, QubesManagerFileWatcher(manager_window.mark_table_for_update)) notifier = ThreadedNotifier(wm, QubesManagerFileWatcher(manager_window.mark_table_for_update))
notifier.start() notifier.start()
wm.add_watch(system_path["qubes_store_filename"], EventsCodes.OP_FLAGS.get('IN_MODIFY')) wm.add_watch(system_path["qubes_store_filename"], EventsCodes.OP_FLAGS.get('IN_MODIFY'))
wm.add_watch(os.path.dirname(system_path["qubes_store_filename"]), EventsCodes.OP_FLAGS.get('IN_MOVED_TO'))
wm.add_watch(qubes_clipboard_info_file, EventsCodes.OP_FLAGS.get('IN_CLOSE_WRITE')) wm.add_watch(qubes_clipboard_info_file, EventsCodes.OP_FLAGS.get('IN_CLOSE_WRITE'))
wm.add_watch(os.path.dirname(qubes_clipboard_info_file), EventsCodes.OP_FLAGS.get('IN_CREATE')) wm.add_watch(os.path.dirname(qubes_clipboard_info_file), EventsCodes.OP_FLAGS.get('IN_CREATE'))