Fix some bugs and lots of warnings reported by pyflakes#596
Merged
jamessynge merged 1 commit intopanoptes:developfrom Sep 16, 2018
Merged
Fix some bugs and lots of warnings reported by pyflakes#596jamessynge merged 1 commit intopanoptes:developfrom
jamessynge merged 1 commit intopanoptes:developfrom
Conversation
Fixed some "unknown variable" errors, such as port when it should have been self.port, or the corruption of nickname by someone pasting the word position into the middle of it. Converted some string literals to raw string literals so that the regular expression is not invalid; e.g 'PAN\d\d\d' is invalid because \d is not a valid escape sequence. The author likely meant \d to be the regular expression for matching digits, which should either be '\\d' or r'\d'. Removed unused imports. Marked some imports in __init__.py files with "# pragma: no flakes" so that they can be exported cleanly. Replaced "from x import *" with explicit imports in libfli.py. Removed many unused variables 'e' in statements of the form: except Name as e. Fixed uses of pytest.raises in test_social_messaging where the asserts about the contents of the raised exception were at the wrong indentation level, so were never executed.
wtgee
approved these changes
Sep 16, 2018
| import ctypes | ||
| from ctypes.util import find_library | ||
| from warnings import warn | ||
| import _ctypes |
Member
There was a problem hiding this comment.
@AnthonyHorton is there any chance this is doing some magic simply by importing?
|
|
||
| self.unit_id = load_config()['pan_id'] | ||
| assert re.match('PAN\d\d\d', self.unit_id) is not None | ||
| assert re.match(r'PAN\d\d\d', self.unit_id) is not None |
Member
There was a problem hiding this comment.
I have these changed in #577 as well but I'll just merge after this.
| "Storage bucket does not exist or no permissions. " + | ||
| "Ensure that the PANOPTES_CLOUD_KEY variable is properly set" | ||
| "Storage bucket does not exist or no permissions. " | ||
| "Ensure that the PANOPTES_CLOUD_KEY variable is properly set " |
Member
There was a problem hiding this comment.
This is removed in #577 as we don't use this env var anymore. Like above, I can either merge after or if you want to remove here.
Contributor
Author
There was a problem hiding this comment.
I'd appreciate you handling the merge so that I can just merge this in as is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed some "unknown variable" errors, such as port when
it should have been self.port, or the corruption of
nickname by someone pasting the word position into the
middle of it.
Converted some string literals to raw string literals so
that the regular expression is not invalid; e.g 'PAN\d\d\d'
is invalid because \d is not a valid escape sequence. The
author likely meant \d to be the regular expression for
matching digits, which should either be
'\\d'orr'\d'.Removed unused imports. Marked some imports in init.py
files with "# pragma: no flakes" so that they can be exported
cleanly.
Replaced "from x import *" with explicit imports in libfli.py.
Removed many unused variables 'e' in statements of
the form: except Name as e.
Fixed uses of pytest.raises in test_social_messaging where
the asserts about the contents of the raised exception were
at the wrong indentation level, so were never executed.