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

Fix Windows platform implementation of sessions command #285

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Acters
Copy link

@Acters Acters commented Jun 23, 2024

Description of Changes

This fixes the Windows implementation of enumerating a list of users.
Also, added extra type checks for edge cases to prevent confusing errors, and will now raise a ModuleFailed error incase users variable is not a dict or list of users.

Major Changes Implemented:

  • Commented the hard coded users = users[0] as it caused a type error and it would only allow the very first user in list to display when using the sessions command. This is commented because a future feature can allow picking which user in list to grab info from, instead of all the sessions.
  • Added some basic type checks to make code more robust to possible edge cases. A dict will now be treated like a dict, and a list will always be enumerated. If users variable is neither a dict or list, then it will raise a ModuleFailed error.

Pre-Merge Tasks

  • [ + ] Formatted all modified files w/ python-black
  • [ + ] Sorted imports for modified files w/ isort
  • [ + ] Ran flake8 on repo, and fixed any new problems w/ modified files
  • [ + ] Ran pytest test cases
  • [ + ] Added brief summary of updates to CHANGELOG (under [Unreleased])

This fixes the Windows implementation of enumerating a list of users. 
Also, added extra type checks for edge cases to prevent confusing errors, and will now raise a ModuleFailed error incase users variable is not a dict or list of users.
Added "sessions" command fix to CHANGELOG.md
@Acters Acters changed the title Fix Windows platform implementation of Session command Fix Windows platform implementation of sessions command Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant