PK!a!9&&wallpaper_app/__init__.pyfrom .statusbar_app import launch_app PK!_Lyywallpaper_app/image_handler.pyimport time import shutil import tempfile import subprocess import requests class UnsplashWrapper: def __init__(self, app_id=None): self.base_url = 'https://api.unsplash.com/' self.app_id = app_id if self.app_id is None: self.headers = None else: self.headers = { 'Accept-Version': 'v1', 'Authorization': f'Client-ID {app_id}' } def _request(self, endpoint, data=None): if self.app_id is None: raise RuntimeError('App ID must not be None') r = requests.get( f'{self.base_url}/{endpoint}', data=data, headers=self.headers) return r.json() def save_random_image(self, fd, collections=None): if self.app_id is None: cols = ','.join(collections or []) url = f'https://source.unsplash.com/collection/{cols}' r = requests.get(url, stream=True) shutil.copyfileobj(r.raw, fd) else: data = self._request( '/photos/random', data=dict(collections=','.join(collections or []))) img_url = data['urls']['full'] r = requests.get(img_url, stream=True, headers=self.headers) shutil.copyfileobj(r.raw, fd) def set_wallpaper(fname): script = f"""/usr/bin/osascript<VSQi[Ψc+"4-5UJΤ.}~tldlz%& U.>QuY>g'5ƨob19\,0>?jݟ221\>Ж WW`x(/Cyyeq88sATGw߾e6:>٧] QE[h1~dq&7t JʻɅnwb'YRs3z~Z+f'ׅX.+^{؎VuBxPECԼQZͩ!]\PK!Hc(hB$wallpaper_app-0.0.1.dist-info/RECORD1S0ߒbm B*B$Iy;u-M8H(緄IB4~wh`yRլ3|h/u6JcuTpAܼx65ii*Ý**JbqJo嫔 }o,l,P|BRDI/v,/ބ1wt6b3|C&!*ʍ&3AMvLmDz)4%/,̓t8r?AK)uYÍ@*k6y%-]׿f2S(SX6Ͱ ^?콁TvMmlWl?YgA1Fzma e9b㝛!41PK!a!9&&wallpaper_app/__init__.pyPK!_Lyy]wallpaper_app/image_handler.pyPK!W"[[wallpaper_app/statusbar_app.pyPK!H1ʮ.:. wallpaper_app-0.0.1.dist-info/entry_points.txtPK!HWY## wallpaper_app-0.0.1.dist-info/WHEELPK!H7!& wallpaper_app-0.0.1.dist-info/METADATAPK!Hc(hB$wallpaper_app-0.0.1.dist-info/RECORDPK2G