-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwallpaper.py
35 lines (27 loc) · 930 Bytes
/
wallpaper.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
import random
import wallpaper_unsplash
import wallpaper_pexels
import wallpaper_wsupercars
import datetime
import utils
if __name__ == '__main__':
print(datetime.datetime.now())
source = random.choice(['Pexels', 'Unsplash', 'WSupercars'])
if source == 'Pexels':
print('Pexels')
mobile, desktop, square = [], [], []
while len(desktop) < 1:
data = wallpaper_pexels.get_data()
photos = data["photos"]
mobile, desktop, square = wallpaper_pexels.sort_photos(photos)
wallpaper_pexels.get_wallpapers(desktop)
utils.set_wallpaper()
elif source == 'Unsplash':
print('Unsplash')
wallpaper_unsplash.get_wallpapers(wallpaper_unsplash.get_data())
utils.set_wallpaper()
elif source == 'WSupercars':
print('WSupercars')
wallpaper_wsupercars.get_wallpapers()
utils.set_wallpaper()
print()