Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract username from session #290

Merged
merged 4 commits into from
Jan 6, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Shorten line length
  • Loading branch information
jacebrowning committed Jan 6, 2019
commit fffc64781153d67412b1c658784448a0d2ae3ee7
8 changes: 4 additions & 4 deletions pylast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def __init__(
# Load session_key and username from authentication token if provided
if token and not self.session_key:
sk_gen = SessionKeyGenerator(self)
self.session_key, self.username = sk_gen.get_web_auth_session_key_and_username(
self.session_key, self.username = sk_gen.get_web_auth_session_key_username(
url=None, token=token
)

Expand Down Expand Up @@ -1045,9 +1045,9 @@ def get_web_auth_url(self):

return url

def get_web_auth_session_key_and_username(self, url, token=""):
def get_web_auth_session_key_username(self, url, token=""):
"""
Retrieves the session key and username of a web authorization process by its URL.
Retrieves the session key/username of a web authorization process by its URL.
"""

if url in self.web_auth_tokens.keys():
Expand All @@ -1072,7 +1072,7 @@ def get_web_auth_session_key(self, url, token=""):
"""
Retrieves the session key of a web authorization process by its URL.
"""
session_key, _username = self.get_web_auth_session_key_and_username(url, token)
session_key, _username = self.get_web_auth_session_key_username(url, token)
return session_key

def get_session_key(self, username, password_hash):
Expand Down
5 changes: 3 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
universal = 1

[flake8]
ignore = E501,W503
ignore = W503
max_line_length = 88

[metadata]
license_file = COPYING

[pycodestyle]
ignore = E501
max_line_length = 88