-
Notifications
You must be signed in to change notification settings - Fork 56
update README.md & fix oneshot.py hidden essid error: KeyError: 'ESSID' #5
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: DroidKali <[email protected]>
Signed-off-by: DroidKali <[email protected]>
Reviewer's GuideThis PR updates all installation and download URLs in README.md to point to the new kimocoder repository and enhances oneshot.py to safely handle missing ESSID values by providing a default of 'Unknown', preventing KeyError exceptions. State Diagram for ESSID Value Assignment in oneshot.pystateDiagram-v2
title State Diagram for ESSID Value Assignment in oneshot.py
[*] --> CheckESSIDPresence
CheckESSIDPresence: Network data received
CheckESSIDPresence --> ESSID_Exists: 'ESSID' key found
CheckESSIDPresence --> ESSID_Missing: 'ESSID' key not found
ESSID_Exists --> AssignESSIDValue: essid = network['ESSID']
ESSID_Missing --> AssignDefaultESSID: essid = "Unknown" (using .get())
AssignESSIDValue --> ESSID_Ready
AssignDefaultESSID --> ESSID_Ready
ESSID_Ready --> [*]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @DroidKali - I've reviewed your changes - here's some feedback:
- Extract the default 'Unknown' ESSID placeholder into a constant and reuse the essid variable in the membership check to avoid duplicate .get calls.
- Consider filtering out or flagging networks missing the ESSID instead of displaying them as 'Unknown' to reduce potential confusion in scan results.
- Ensure any other references (e.g., badges, issue tracker links) are also updated to point to the new kimocoder/OneShot repository for consistency.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@@ -1013,14 +1013,14 @@ def colored(text, color=None): | |||
for n, network in network_list_items: | |||
number = f'{n})' | |||
model = '{} {}'.format(network['Model'], network['Model number']) | |||
essid = truncateStr(network['ESSID'], 25) | |||
essid = truncateStr(network.get('ESSID', 'Unknown'), 25) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: Extract raw ESSID before truncation to reduce duplication
Assign the result of network.get('ESSID', 'Unknown')
to a variable before using it, to avoid duplication and improve maintainability.
Summary by Sourcery
Update documentation URLs to point to the kimocoder repository and add fallback for missing ESSID values to prevent KeyError in oneshot.py.
Bug Fixes:
Documentation: