backup.py

changeset 78
83b43987e61e
parent 76
4b08fca3ce34
child 79
b075b3db3044
--- a/backup.py	Sun Jan 28 11:01:45 2018 +0000
+++ b/backup.py	Sun Jan 28 11:04:52 2018 +0000
@@ -7,7 +7,7 @@
 import time
 import borgend
 import repository
-import sleep
+import dreamtime
 from enum import IntEnum
 from instance import BorgInstance
 from threading import Thread, Lock, Condition
@@ -143,9 +143,9 @@
                                       default="dreamtime")
 
         if scheduling=="dreamtime":
-            self.timeclass=sleep.DreamTime
+            self.timeclass=dreamtime.DreamTime
         elif scheduling=="realtime":
-            self.timeclass=sleep.MonotonicTime
+            self.timeclass=dreamtime.MonotonicTime
         elif scheduling=="manual":
             self.backup_interval=0
         else:
@@ -172,7 +172,7 @@
         self.lastrun_finished=None
         self.state=State.INACTIVE
         self.errors=Errors.OK
-        self.timeclass=sleep.DreamTime
+        self.timeclass=dreamtime.DreamTime
 
         self.__decode_config(cfg)
 
@@ -300,7 +300,7 @@
         self.current_operation=op
         # Update scheduled time to real starting time to schedule
         # next run relative to this
-        self.current_operation.time=sleep.MonotonicTime.now()
+        self.current_operation.time=dreamtime.MonotonicTime.now()
         self.state=State.ACTIVE
         # Reset error status when starting a new operation
         self.errors=Errors.OK
@@ -472,7 +472,7 @@
             if self.retry_interval==0:
                 return None
             else:
-                tm=sleep.MonotonicTime(self.lastrun_finished+self.retry_interval)
+                tm=dreamtime.MonotonicTime(self.lastrun_finished+self.retry_interval)
                 return Operation(Operation.CREATE, tm, reason='retry')
         else:
             if self.backup_interval==0:
@@ -518,13 +518,13 @@
         return res[0]
 
     def create(self):
-        op=Operation(Operation.CREATE, sleep.MonotonicTime.now(), reason='manual')
+        op=Operation(Operation.CREATE, dreamtime.MonotonicTime.now(), reason='manual')
         with self._cond:
             self.scheduled_operation=op
             self._cond.notify()
 
     def prune(self):
-        op=Operation(Operation.PRUNE, sleep.MonotonicTime.now(), reason='manual')
+        op=Operation(Operation.PRUNE, dreamtime.MonotonicTime.now(), reason='manual')
         with self._cond:
             self.scheduled_operation=op
             self._cond.notify()

mercurial