Fabian P. Schmidt
9bed67a4fd
Migrate to Python 3
...
This also includes a refresh of the requirements after the Python3
transition.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-10 23:29:19 +02:00
Alfredos-Panagiotis Damkalis
a83a707de2
migrations: Replace bytes with string literals
...
Missing changes from previous commit.
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-10 20:07:31 +02:00
Alfredos-Panagiotis Damkalis
9bf43438d2
utils/export_as_csv: fix encoding for csv writer
...
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-09 01:12:37 +02:00
Fabian P. Schmidt
a6de5b44f9
{api/views.py|base/models.py}: Disable false-positive no-member pylint errors (E1101)
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:17:08 +01:00
Fabian P. Schmidt
ec73abeaa7
migrations: Replace bytes with string literals
...
As long as the bytes literal contains only ASCII data it can be replaced
with a string literal already in Python 2.
https://docs.djangoproject.com/en/1.11/topics/python3/#unicode-literals
The following command was used to generate this patch:
```
sed -i "s/b'\([\x00-\x7F]*\)'/'\1'/g" network/base/migrations/*
```
Similar commit in db: librespacefoundation/satnogs/satnogs-db@f0c0c9bc
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:16:15 +01:00
Fabian P. Schmidt
e386eb658d
Add comments for missing atttributes in ephem.Observer class slots (E0237)
...
Fixes assigning-non-slot (E0237) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:04:26 +01:00
Fabian P. Schmidt
02eda83a84
utils/export_as_csv: Catch more-specific TypeError instead of broad Exception (W0703)
...
Fixes the broad-except (W0703) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:02:23 +01:00
Fabian P. Schmidt
4c9cd66661
models/Observation: Improve requests exception handling (W0703)
...
Fixes a broad-except (W0703) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:01:49 +01:00
Fabian P. Schmidt
caa861b187
forms/BaseObservationFormSet: Add missing initialization of member variable (W0201)
...
Fixes the attribute-defined-outside-init (W0201) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:00:51 +01:00
Fabian P. Schmidt
fbabd125ad
views/ObservationListView: Add missing initialization of member variable (W0201)
...
Fixes an attribute-defined-outside-init (W0201) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:00:34 +01:00
Fabian P. Schmidt
86c6e6b63b
api/serializers: Add missing inizialization (W0201)
...
Fixes an attribute-defined-outside-init (W0201) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 18:00:34 +01:00
Fabian P. Schmidt
781097da40
test_utils: Add missing docstrings (C0111)
...
Fixes missing-docstring (C0111) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:58:30 +01:00
Fabian P. Schmidt
acb26329c5
test_utils: Locally disable redefined-outer-name pylint error (W0621)
...
This pylint error is in contradiction with pytest using the argument
name to detect which fixture should be passed to the test method.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:58:28 +01:00
Fabian P. Schmidt
1212dd6cfd
utils/community_get_discussion_details: Re-use existing formatstring argument (W1308)
...
Fixes duplicate-string-formatting-argument (W1308) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 17:56:09 +01:00
Fabian P. Schmidt
7471f8567f
Remove unncessary pass statements in empty classes with docstring (W0107)
...
Fixes unnecessary-pass (W0107) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 15:26:42 +00:00
Fabian P. Schmidt
903b264814
management/commands/fetch_data: Locally disable redefined-builtin pylint error (W0622)
...
In Python 3.3 ConnectionError was added as subclass in python builtins,
see PEP3151 or [1] for more details.
[1]: https://docs.python.org/3/whatsnew/3.3.html#pep-3151-reworking-the-os-and-io-exception-hierarchy
Fixes redefined-builtin (W0622) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 15:17:33 +00:00
Fabian P. Schmidt
283b994a67
admin/AntennaAdmin: Replace __unicode__ by __str__ in list_display
...
__unicode__ was removed in Python 3.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 15:05:34 +00:00
Fabian P. Schmidt
7443d76a2f
users/models: Replace __unicode__ by __str__ (W5102)
...
The special method __unicode__ is python2-only,
in python3 it's merged with __str__. In order to be py23-compatible
the python_2_unicode_compatible decorator is used, see
https://docs.djangoproject.com/en/1.11/topics/python3/#str-and-unicode-methods
Equivalent commit in db: librespacefoundation/satnogs/satnogs-db@9a0ef30e
Equivalent commit for base model: d20943ce
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-08 14:45:51 +00:00
Fabian P. Schmidt
aa0b657de1
commands/update_station_last_seen: Rename unused argument to original specifier (W0613)
...
Fixes unused-argument (W0613) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-05 00:25:19 +01:00
Fabian P. Schmidt
538ea52c1a
tasks/clean_observations: Fix premature task termination in 'stage' environment
...
Skip the archival of old observations which just got deleted instead
of terminating the whole task at this point.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 19:46:06 +01:00
Alfredos-Panagiotis Damkalis
1635a14640
Retry archive.org uploading on "SlowDown" error
...
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-04 18:22:17 +02:00
Fabian P. Schmidt
e1ed302e64
utils/drifted_frq: Use python3 round builtin (W1633)
...
This changes the used rounding strategy.
See "Whats new in python3"[1] for more details:
> Exact halfway cases are now rounded to the nearest even result
> instead of away from zero.
> (For example, round(2.5) now returns 2 rather than 3.)
Fixes round-builtin (W1633) pylint error.
[1]: https://docs.python.org/3/whatsnew/3.0.html#builtins
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:31:05 +01:00
Fabian P. Schmidt
af9f9bf8e9
api/serializers: Use integer literal instead of pow
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:30:49 +01:00
Fabian P. Schmidt
0203ab17a7
templatetags/tags: Use integer literal instead of pow
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:30:49 +01:00
Fabian P. Schmidt
11df29ba1d
views: Use str builtin instead of single-argument formatstring
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:07:06 +01:00
Fabian P. Schmidt
1719473d70
Use str(error) instead of error.message (W1645)
...
Fixes exception-message-attribute (W1645) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 15:07:06 +01:00
Fabian P. Schmidt
6ed02d4dd9
scheduling/create_new_observation: Add verbose docstring
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:12 +00:00
Fabian P. Schmidt
642a0a2c61
Add from __future__ import division to all relevant files (W1619)
...
Fixes old-divison (W1619) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:12 +00:00
Fabian P. Schmidt
a7692b4627
base/scheduling: Make division operations "true division"-safe
...
Use explicit typecast to float to prevent ambiguous division operation
in the first two cases. In the last case (timdelta, int), the python2
timedelta doesn't support the division operator (this was intruduced
in python 3.2). Use old_div instead.
This change clarifies that true division is the desired behaviour
in these three code locations.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:12 +00:00
Fabian P. Schmidt
f774025a6f
utils/sync_demoddata_to_db: Raise RequestException if sync fails (W0703)
...
Let the caller handle the exception in case the sync fails.
Fixes a broad-except (W0703) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 14:08:00 +01:00
Fabian P. Schmidt
426e3585f8
utils/sync_demoddata_to_db: Use requests instead of urllib2 (W1648, W1658)
...
Fixes the bad-python3-import (W1648) and deprecated-urllib-function (W1658) pylint errors.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:55:31 +01:00
Fabian P. Schmidt
575ecc739b
settings: Add DB_API_TIMEOUT
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2020-01-04 13:36:41 +01:00
Alfredos-Panagiotis Damkalis
bd9a37dd50
Fix lint issues of the latest commits
...
Signed-off-by: Alfredos-Panagiotis Damkalis <fredy@fredy.gr>
2020-01-03 19:01:57 +02:00
Fabian P. Schmidt
a026edd36a
utils/sync_demoddata_to_db: Fix method rename from display_payload to display_payload_hex
...
Fixes #702 (regression introduced in 3609e46b
).
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 20:50:18 +01:00
Fabian P. Schmidt
834c7b67fe
management/fetch_data: Re-use fetch_data task
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:38:54 +00:00
Fabian P. Schmidt
8993d7e1b1
settings: Add comment on DB_API_ENDPOINT usage
...
This feature (disable DB data fetching by setting DB_API_ENDPOINT to '')
was added in b522d43
, but never documented.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:38:53 +00:00
Fabian P. Schmidt
bda0580dbe
utils/community_get_discussion_details: Add a sane request timeout
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:28:07 +00:00
Fabian P. Schmidt
dd54caa4e4
utils/community_get_discussion_details: Fix response when commnuity is unreachable
...
Fixes #700 (regression introduced by 10b1292
).
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 14:28:07 +00:00
Fabian P. Schmidt
3609e46b78
Fix demod data display for utf-8 decodable non-CW observations (W1612)
...
Previously for unicode decode-able frames in observations where the transmitter
type was not CW, the hex dump was malformed and contained the unicode decoded
text instead.
Fixes the unicode-builtin (W1612) pylint errors as well.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 13:26:47 +01:00
Fabian P. Schmidt
65b379f6af
utils/export_as_csv: Use str instead of unicode-builtin (W1612)
...
Fixes a unicode-builtin pylint error (W1612).
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 13:26:47 +01:00
Fabian P. Schmidt
88083664a6
views/observation_new_post: Reduce branches (R0912)
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 09:15:06 +00:00
Fabian P. Schmidt
2cfe7561a5
views/observation_new_post: Refactor observations creation into a new function (R0912)
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 09:15:06 +00:00
Fabian P. Schmidt
206053f80f
views/observation_new_post: Combine identical error handlers
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 09:15:06 +00:00
Fabian P. Schmidt
308cbe32d0
views/observation_new_post: Re-order conditionals
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 09:15:06 +00:00
Fabian P. Schmidt
c70bf410a0
settings: Use python3-compatible octal literals (E396)
...
Fixes old-octal-literal (E396) pylint error.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 09:02:52 +00:00
Fabian P. Schmidt
bfc0fd639b
Add absolute_import to all relevant files (W1618)
...
Fixes no-absolute-import (W1618) pylint error.
Similar commit in db: librespacefoundation/satnogs/satnogs-db@d4fb5189d19aa7fc12e1adcfbc7b3ca07452fed6
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-31 08:51:04 +00:00
Kevin Pak
50673b5345
Add satnogs-network version number to footer. Placed function for version inside context_processors.py file.
...
Signed-off-by: Kevin Pak <kedpak10@gmail.com>
2019-12-30 11:05:08 +02:00
Fabian P. Schmidt
10b1292059
utils/community_discussion_details: Use requests instead of urllib2 (W1648)
...
Fixes a bad-python3-import pylint error (W1648) caused by using urllib2.
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-30 08:46:37 +00:00
Fabian P. Schmidt
b7a899c1f2
tests: Add test for community_get_discussion_details
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-30 08:46:37 +00:00
Fabian P. Schmidt
fbd4486081
views: Move community discussion details gathering to utils
...
Signed-off-by: Fabian P. Schmidt <kerel@mailbox.org>
2019-12-30 08:46:37 +00:00