MCPcopy Create free account
hub / github.com/geekcomputers/Python / extract_wall

Method extract_wall

Windows_Wallpaper_Script/wallpaper_extract.py:69–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

67 # Remove all files Not having Wallpaper Resolution
68 @staticmethod
69 def extract_wall():
70 w = Wallpaper
71 w.time_gap("Extracting Wallpapers")
72 for filename in os.listdir(w.file_urls["wall_dst"]):
73 base_file, ext = os.path.splitext(filename)
74 if ext == ".jpg":
75 try:
76 im = Image.open(w.file_urls["wall_dst"] + filename)
77 except IOError:
78 print("This isn't a picture.", filename)
79 if list(im.size)[0] != 1920 and list(im.size)[0] != 1080:
80 im.close()
81 os.remove(w.file_urls["wall_dst"] + filename)
82 else:
83 im.close()
84
85 # Arrange the wallpapers into the corresponding folders
86 @staticmethod

Callers 1

exec_allMethod · 0.80

Calls 3

time_gapMethod · 0.80
closeMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected