2 |
2 |
3 import logging |
3 import logging |
4 from threading import Thread |
4 from threading import Thread |
5 |
5 |
6 logging.basicConfig(#filename='example.log', |
6 logging.basicConfig(#filename='example.log', |
7 format='%(levelname)s:%(message)s', |
7 #format='%(levelname)s:%(message)s', |
8 level=logging.DEBUG) |
8 level=logging.DEBUG) |
|
9 |
|
10 logger=logging.getLogger(__name__) |
9 |
11 |
10 from backup import Backup |
12 from backup import Backup |
11 from config import settings |
13 from config import settings |
12 from queue import Queue |
14 from queue import Queue |
13 from ui import BorgendTray |
15 from ui import BorgendTray |
15 |
17 |
16 backupconfigs=settings['backups'] |
18 backupconfigs=settings['backups'] |
17 backups=[None]*len(backupconfigs); |
19 backups=[None]*len(backupconfigs); |
18 |
20 |
19 for i in range(len(backupconfigs)): |
21 for i in range(len(backupconfigs)): |
20 logging.info('Setting up backup set %d' % i) |
22 logger.info('Setting up backup set %d' % i) |
21 backups[i]=Backup(i, backupconfigs[i]) |
23 backups[i]=Backup(i, backupconfigs[i]) |
22 backups[i].schedule() |
24 backups[i].schedule() |
23 |
25 |
24 if __name__ == "__main__": |
26 if __name__ == "__main__": |
25 #print(settings) |
27 #print(settings) |