How to use the vorta.models.BackupProfileModel.get function in vorta

To help you get started, we’ve selected a few vorta examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github borgbase / vorta / tests / test_archives.py View on Github external
def test_prune_intervals(app, qtbot):
    prune_intervals = ['hour', 'day', 'week', 'month', 'year']
    main = app.main_window
    tab = main.archiveTab
    profile = BackupProfileModel.get(id=1)

    for i in prune_intervals:
        getattr(tab, f'prune_{i}').setValue(9)
        tab.save_prune_setting(None)
        profile = profile.refresh()
        assert getattr(profile, f'prune_{i}') == 9
github borgbase / vorta / src / vorta / views / main_window.py View on Github external
def profile_select_action(self, index):
        self.current_profile = BackupProfileModel.get(id=self.profileSelector.currentData())
        self.archiveTab.populate_from_profile()
        self.repoTab.populate_from_profile()
        self.sourceTab.populate_from_profile()
        self.scheduleTab.populate_from_profile()
github borgbase / vorta / src / vorta / views / main_window.py View on Github external
def profile_delete_action(self):
        if self.profileSelector.count() > 1:
            to_delete = BackupProfileModel.get(id=self.profileSelector.currentData())

            # Remove pending background jobs
            to_delete_id = str(to_delete.id)
            if self.app.scheduler.get_job(to_delete_id):
                self.app.scheduler.remove_job(to_delete_id)

            to_delete.delete_instance(recursive=True)
            self.profileSelector.removeItem(self.profileSelector.currentIndex())
            self.profile_select_action(0)