Exemplo n.º 1
0
    def __set_up_dates_listbox(self):
        liststore = gtk.ListStore(str)
        self.dates_listbox.set_model(liststore)
        cell = gtk.CellRendererText()
        self.dates_listbox.pack_start(cell, True)
        self.dates_listbox.add_attribute(cell, 'text', 0)

        self.version2index = dict()
        self.index2version = dict()
        index = 0
        for version in self.restore_control_center.get_all_versions():
            if version == -1:
                formatted = 'Now'
            else:
                datetime = epoche2date(version)
                date, time = datetime.split('_')
                formatted = date + '  ' + time.replace('-', ':')

            self.index2version[index] = version
            self.version2index[version] = index
            index += 1

            self.dates_listbox.append_text(formatted)
Exemplo n.º 2
0
    def mount(self, version, as_readonly):
        mount_point = os.path.join(self._temp_dir(), epoche2date(version))

        os.symlink(os.path.join(self.backup_path, str(self.backup_id), str(version)), mount_point)

        return SymlinkedFileSystem(mount_point)
Exemplo n.º 3
0
 def mount(self, version, as_readonly=False):
     mount_point = os.path.join(self._temp_dir(), epoche2date(version))
     self.__make_mount_point_dir(mount_point)
     self.__mount_cozyfs(mount_point, version, as_readonly)
     return FileSystem(mount_point)