PyCharm grand repo wide reformat with black formatter

This commit is contained in:
Xevion
2020-03-08 20:49:06 -05:00
parent 66c2ff228c
commit bc3cd82a95
16 changed files with 487 additions and 341 deletions

View File

@@ -11,7 +11,7 @@ from . import pull
def main():
logging.basicConfig(level=logging.INFO)
logging.info('Pulling data from Spotify')
logging.info("Pulling data from Spotify")
refresh()
process.main()
@@ -19,14 +19,20 @@ def main():
# Refreshes tracks from files if the token from Spotipy has expired,
# thus keeping us up to date in most cases while keeping rate limits
def refresh():
file_path = os.path.join(sys.path[0], f'.cache-{auth.USERNAME}')
file_path = os.path.join(sys.path[0], f".cache-{auth.USERNAME}")
if os.path.exists(file_path):
cache = json.load(open(file_path, 'r'))
if True or time.time() > cache['expires_at']:
logging.info('Refreshing Spotify data by pulling tracks, this may take a moment.')
cache = json.load(open(file_path, "r"))
if True or time.time() > cache["expires_at"]:
logging.info(
"Refreshing Spotify data by pulling tracks, this may take a moment."
)
pull.main()
else:
logging.info('Spotify data deemed to be recent enough (under {} seconds old)'.format(cache['expires_in']))
logging.info(
"Spotify data deemed to be recent enough (under {} seconds old)".format(
cache["expires_in"]
)
)
else:
pull.main()