mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
Check f-strings (#1184)
This commit is contained in:
parent
1d920ff5df
commit
c738376b80
@ -49,6 +49,7 @@ Add your changes below.
|
||||
- featured_playlists
|
||||
- category_playlists
|
||||
- Added FAQ entry for inaccessible playlists
|
||||
- Workflow to check for f-strings
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@ -29,19 +29,18 @@ $ source env/bin/activate
|
||||
|
||||
### Lint
|
||||
|
||||
pip install .[test]
|
||||
|
||||
To automatically fix some of the code style:
|
||||
|
||||
pip install autopep8
|
||||
autopep8 --in-place --aggressive --recursive .
|
||||
|
||||
To verify the code style:
|
||||
|
||||
pip install flake8
|
||||
flake8 .
|
||||
|
||||
To make sure if the import lists are stored correctly:
|
||||
|
||||
pip install isort
|
||||
isort . -c
|
||||
|
||||
Sort them automatically with:
|
||||
|
||||
2
setup.py
2
setup.py
@ -12,7 +12,9 @@ extra_reqs = {
|
||||
'pymemcache>=3.5.2'
|
||||
],
|
||||
'test': [
|
||||
'autopep8>=2.3.2',
|
||||
'flake8>=7.1.1',
|
||||
'flake8-string-format>=0.3.0',
|
||||
'isort>=5.13.2'
|
||||
]
|
||||
}
|
||||
|
||||
@ -1244,10 +1244,8 @@ class Spotify:
|
||||
if they follow the playlist. Maximum: 5 ids.
|
||||
|
||||
"""
|
||||
endpoint = "playlists/{}/followers/contains?ids={}"
|
||||
return self._get(
|
||||
endpoint.format(playlist_id, ",".join(user_ids))
|
||||
)
|
||||
endpoint = f"playlists/{playlist_id}/followers/contains?ids={','.join(user_ids)}"
|
||||
return self._get(endpoint)
|
||||
|
||||
def me(self):
|
||||
""" Get detailed profile information about the current user.
|
||||
|
||||
@ -1224,19 +1224,21 @@ class RequestHandler(BaseHTTPRequestHandler):
|
||||
self._write("<html><body><h1>Invalid request</h1></body></html>")
|
||||
return
|
||||
|
||||
self._write("""<html>
|
||||
self._write(f"""<html>
|
||||
<script>
|
||||
window.close()
|
||||
</script>
|
||||
<body>
|
||||
<h1>Authentication status: {}</h1>
|
||||
<h1>Authentication status: {status}</h1>
|
||||
This window can be closed.
|
||||
<script>
|
||||
window.close()
|
||||
</script>
|
||||
<button class="closeButton" style="cursor: pointer" onclick="window.close();">Close Window</button>
|
||||
<button class="closeButton" style="cursor: pointer" onclick="window.close();">
|
||||
Close Window
|
||||
</button>
|
||||
</body>
|
||||
</html>""".format(status))
|
||||
</html>""")
|
||||
|
||||
def _write(self, text):
|
||||
return self.wfile.write(text.encode("utf-8"))
|
||||
|
||||
Loading…
Reference in New Issue
Block a user