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

Undefined name: commands in octosuite.py #10

Closed
cclauss opened this issue Jan 22, 2023 · 4 comments
Closed

Undefined name: commands in octosuite.py #10

cclauss opened this issue Jan 22, 2023 · 4 comments

Comments

@cclauss
Copy link

cclauss commented Jan 22, 2023

Undefined name: commands in octosuite.py. The variable commands is not defined or imported in this file.

% flake8 . --count --select=E9,F63,F7,F82,Y --show-source --statistics

./octosuite/octosuite.py:38:31: F821 undefined name 'commands'
        options = [i for i in commands if i.startswith(text)]
                              ^
1     F821 undefined name 'commands'
1
@rly0nheart
Copy link
Collaborator

rly0nheart commented Jan 22, 2023

This code is using the readline (for unix-like systems) library to enable tab completion for a list of commands. The completer function takes in the text entered so far and the current state of the completion, and returns the next option that matches the text if one exists. The parse_and_bind and set_completer methods are used to activate the completer function when the tab key is pressed.

On unix-like machines, this code runs without any errors, and on Windows machines, it does not get executed.

@cclauss
Copy link
Author

cclauss commented Jan 23, 2023

Where is commands defined?

@rly0nheart
Copy link
Collaborator

rly0nheart commented Jan 23, 2023

It is never defined and it doesn't return an error

😅I'm guessing you did not run the program, because if you did, you would know that it doesn't return an error.

@cclauss
Copy link
Author

cclauss commented Jan 23, 2023

OK. global commands or nonlocal commands would placate the linter but I think we can close this.

@cclauss cclauss closed this as completed Jan 23, 2023
This issue was closed.
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

No branches or pull requests

2 participants