Example #1
0
	def get_config_treestore(self):
		configstree = Gtk.TreeStore(int, int, int, str, str, str, str)
		# Check if the user has permission to see/edit this configuration
		try:
			snapshots_list = snapper.ListSnapshots(self.config)
		except dbus.exceptions.DBusException:
			return
		parents = []
		self.count = len(snapshots_list)
		for snapshot in snapshots_list:
			if (snapshot[1] == 1): # Pre Snapshot
				parents.append(configstree.append(None , self.snapshot_columns(snapshot)))
			elif (snapshot[1] == 2): # Post snappshot
				parent_node = None
				for parent in parents:
					if (configstree.get_value(parent, 0) == snapshot[2]):
						parent_node = parent
						break
				configstree.append(parent_node , self.snapshot_columns(snapshot))
			else:  # Single snapshot
				configstree.append(None , self.snapshot_columns(snapshot))
		return configstree
Example #2
0
 def on_main_destroy(self, args):
     for config in snapper.ListConfigs():
         for snapshot in snapper.ListSnapshots(config[0]):
             if snapshot[6] != '':
                 snapper.UmountSnapshot(config[0], snapshot[0], 'true')