Skip to content

refactor: simplify redundant string comparisons for y/n input #2655

Description

@martincarapia

Several methods in src/Osintgram.py use verbose y/n input checks:

# current
if value == str("y") or value == str("yes") or value == str("Yes") or value == str("YES"):
elif value == str(""):
elif value == str("n") or value == str("no") or value == str("No") or value == str("NO"):

# proposed
if value.lower() in ('y', 'yes'):
elif value == '':
elif value.lower() in ('n', 'no'):

Affected methods: get_fwersemail, get_fwingsemail, get_fwingsnumber, get_fwersnumber

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions