Fixes attribute error in #1.

This commit is contained in:
Manu 2018-11-01 09:10:11 +08:00
parent 5bc5a198cf
commit a9d01a4db4
2 changed files with 12 additions and 11 deletions

View File

@ -81,7 +81,7 @@
<item row="3" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Need hosting for your Borg repository? &lt;a href=&quot;https://www.borgbackup.org/support/commercial.html&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;View providers&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Needs Borg installed server-side. Or try &lt;a href=&quot;https://www.borgbase.com&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;BorgBase.&lt;/span&gt;&lt;/a&gt; 100GB free during Beta.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="openExternalLinks">
<bool>true</bool>
@ -101,7 +101,7 @@
<item row="0" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>SSH Login Key:</string>
<string>SSH Key:</string>
</property>
</widget>
</item>
@ -122,7 +122,7 @@
<item row="1" column="1">
<widget class="QLabel" name="label_2">
<property name="text">
<string>To access repository securely. Keep at default if you already have one. Or create new key.</string>
<string>To access repository securely. Keep default to use all your existing keys. Or create new key.</string>
</property>
</widget>
</item>

View File

@ -5,7 +5,6 @@ from .borg_runner import BorgThread
from .models import BackupProfileMixin
class VortaScheduler(QtScheduler, BackupProfileMixin):
def __init__(self, parent):
super().__init__()
@ -15,22 +14,24 @@ class VortaScheduler(QtScheduler, BackupProfileMixin):
def reload(self):
self.remove_all_jobs()
if self.profile.schedule_mode == 'off':
self.next_job = 'Manual Backups'
return None
elif self.profile.schedule_mode == 'interval':
trigger = cron.CronTrigger(hour=f'*/{profile.schedule_interval_hours}',
trigger = None
if self.profile.schedule_mode == 'interval':
trigger = cron.CronTrigger(hour=f'*/{self.profile.schedule_interval_hours}',
minute=self.profile.schedule_interval_minutes)
elif self.profile.schedule_mode == 'fixed':
trigger = cron.CronTrigger(hour=self.profile.schedule_fixed_hour,
minute=self.profile.schedule_fixed_minute)
self.add_job(self.create_backup, trigger, id='create-backup', misfire_grace_time=180)
if trigger is not None:
self.add_job(self.create_backup, trigger, id='create-backup', misfire_grace_time=180)
@property
def next_job(self):
job = self.get_job('create-backup')
return job.next_run_time.strftime('%Y-%m-%d %H:%M')
if job is None:
return 'Manual Backups'
else:
return job.next_run_time.strftime('%Y-%m-%d %H:%M')
@classmethod
def create_backup(cls):