-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
36 lines (29 loc) · 1.17 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import os
import time
from wallengine import wallengine, config
import logging
# https://docs.python.org/3.6/howto/logging-cookbook.html
logging.basicConfig(level=logging.INFO,
format='%(asctime)s *%(levelname)s* %(name)s in %(filename)s.%(funcName)s (%(threadName)s): %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
filename=os.path.join('.', 'walls.log'),
filemode='a')
console = logging.StreamHandler()
console.setLevel(logging.WARNING)
console.setFormatter(logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s'))
logging.getLogger("").addHandler(console)
engine = wallengine.WallEngine(
wall_cache_dir=config.directory,
wall_cache_size=int(config.slideshow_screens * 20 / config.slideshow_minutes), # cache for 20 minutes
wall_cache_tags=config.tags,
wall_cache_rng_pool_size=config.rng_pool_size
)
while True:
# Windows wallpaper picture setting
engine.next_wallpaper()
time.sleep(config.slideshow_minutes * 60)
"""
# Windows wallpaper: slideshow setting
engine.renew_wall_cache(cleanup_files=True)
time.sleep(config.slideshow_minutes * 60 * 2 * 0.8)
"""