Skip to content

Commit

Permalink
Automatically check f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanebruckert committed Jan 23, 2025
1 parent 1d920ff commit c831028
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
5 changes: 2 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
'pymemcache>=3.5.2'
],
'test': [
'autopep8>=2.3.2',
'flake8>=7.1.1',
'flake8-string-format>=0.3.0',
'isort>=5.13.2'
]
}
Expand Down
6 changes: 2 additions & 4 deletions spotipy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1244,10 +1244,8 @@ def playlist_is_following(
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.
Expand Down
28 changes: 15 additions & 13 deletions spotipy/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1224,19 +1224,21 @@ def do_GET(self):
self._write("<html><body><h1>Invalid request</h1></body></html>")
return

self._write("""<html>
<script>
window.close()
</script>
<body>
<h1>Authentication status: {}</h1>
This window can be closed.
<script>
window.close()
</script>
<button class="closeButton" style="cursor: pointer" onclick="window.close();">Close Window</button>
</body>
</html>""".format(status))
self._write(f"""<html>
<script>
window.close()
</script>
<body>
<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>
</body>
</html>""")

def _write(self, text):
return self.wfile.write(text.encode("utf-8"))
Expand Down

0 comments on commit c831028

Please sign in to comment.