-
Notifications
You must be signed in to change notification settings - Fork 115
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
Python 3 support for ShinySDR #145
Open
quentinmit
wants to merge
21
commits into
kpreid:master
Choose a base branch
from
w1xm:python3
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fa08731
Update setup.py for Python 3
quentinmit 5d8c982
Update testutil.py for Python 3
quentinmit f16517b
More Python 3 support
quentinmit c7a0606
Work around Twisted Python 3.8 compatibility issue
quentinmit 1267477
Call putChild with byte strings for Python 3 compatibility
quentinmit 7b882d4
Fix make_websocket_url to use strings on Python 3
quentinmit 9d77173
Filenames and MIME types are strings in Python 3
quentinmit 97e2ef0
Return JSON as utf-8
quentinmit c9dd568
Parse WebSocket path correctly on Python 3
quentinmit 480d0cf
Python blocks must have a reference held on the Python side as long a…
quentinmit 55f2ece
Monkey-patch txWS to fix it on Python 3
quentinmit 48bcccc
Fix BlockResource for Python 3
quentinmit 9089b68
sort can fail on Python 3 if objects are not comparable
quentinmit 1529d7f
Iterators no longer have a next() method in Python 3
quentinmit 291496f
Filenames are not bytes in Py3
quentinmit b5b609c
Handle application/json headers with and without charset specified
quentinmit 3a7529b
Address lint errors
quentinmit 11b6d2f
More bytes/str changes that fix tests on Python 3.8
quentinmit 9835805
Fix lint
quentinmit d4d6684
Address review comments
quentinmit 0f0992b
Test removing charset from application/json headers
quentinmit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -302,8 +302,8 @@ def __do_connect(self): | |
# It would make slightly more sense to use unsigned chars, but blocks.float_to_uchar does not support vlen. | ||
self.__fft_converter = blocks.float_to_char(vlen=self.__freq_resolution, scale=1.0) | ||
|
||
fft_sink = self.__fft_cell.create_sink_internal(numpy.dtype((numpy.int8, output_length))) | ||
scope_sink = self.__scope_cell.create_sink_internal(numpy.dtype(('c8', self.__time_length))) | ||
self.__fft_sink = self.__fft_cell.create_sink_internal(numpy.dtype((numpy.int8, output_length))) | ||
self.__scope_sink = self.__scope_cell.create_sink_internal(numpy.dtype(('c8', self.__time_length))) | ||
Comment on lines
+305
to
+306
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are these being made attributes? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Letting Python garbage collect them while they're still in the flowgraph causes crashes now. |
||
scope_chunker = blocks.stream_to_vector_decimator( | ||
item_size=gr.sizeof_gr_complex, | ||
sample_rate=sample_rate, | ||
|
@@ -324,15 +324,15 @@ def __do_connect(self): | |
logarithmizer) | ||
if self.__after_fft is not None: | ||
self.connect(logarithmizer, self.__after_fft) | ||
self.connect(self.__after_fft, self.__fft_converter, fft_sink) | ||
self.connect(self.__after_fft, self.__fft_converter, self.__fft_sink) | ||
self.connect((self.__after_fft, 1), blocks.null_sink(gr.sizeof_float * self.__freq_resolution)) | ||
else: | ||
self.connect(logarithmizer, self.__fft_converter, fft_sink) | ||
self.connect(logarithmizer, self.__fft_converter, self.__fft_sink) | ||
if self.__enable_scope: | ||
self.connect( | ||
self.__gate, | ||
scope_chunker, | ||
scope_sink) | ||
self.__scope_sink) | ||
finally: | ||
self.__context.unlock() | ||
|
||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
Add a comment indicating this is for version compatibility so we can strip it out later.
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.
Done