Skip to content

Fix some bugs and lots of warnings reported by pyflakes#596

Merged
jamessynge merged 1 commit intopanoptes:developfrom
jamessynge:formatting-cleanup
Sep 16, 2018
Merged

Fix some bugs and lots of warnings reported by pyflakes#596
jamessynge merged 1 commit intopanoptes:developfrom
jamessynge:formatting-cleanup

Conversation

@jamessynge
Copy link
Copy Markdown
Contributor

@jamessynge jamessynge commented Sep 16, 2018

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.

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.
@jamessynge jamessynge requested a review from wtgee September 16, 2018 00:27
Copy link
Copy Markdown
Member

@wtgee wtgee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yay for cleanup, thanks!

Comment thread pocs/camera/sbigudrv.py
import ctypes
from ctypes.util import find_library
from warnings import warn
import _ctypes
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd appreciate you handling the merge so that I can just merge this in as is.

@jamessynge jamessynge merged commit 77cfe97 into panoptes:develop Sep 16, 2018
@jamessynge jamessynge deleted the formatting-cleanup branch September 16, 2018 01:19
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.

2 participants