2to3 changes for python3
Mostly list changes, from 2to3 Also missing __future__ needed for _version.py Signed-off-by: Corey Shields <cshields@gmail.com>merge-requests/391/head
parent
dc06369f9a
commit
8734748e50
|
@ -10,6 +10,9 @@
|
||||||
|
|
||||||
"""Git implementation of _version.py."""
|
"""Git implementation of _version.py."""
|
||||||
|
|
||||||
|
from __future__ import absolute_import, division, print_function, \
|
||||||
|
unicode_literals
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
|
@ -50,7 +50,7 @@ def cache_get_key(*args, **kwargs):
|
||||||
serialise = []
|
serialise = []
|
||||||
for arg in args:
|
for arg in args:
|
||||||
serialise.append(str(arg))
|
serialise.append(str(arg))
|
||||||
for key, arg in kwargs.items():
|
for key, arg in list(kwargs.items()):
|
||||||
serialise.append(str(key))
|
serialise.append(str(key))
|
||||||
serialise.append(str(arg))
|
serialise.append(str(arg))
|
||||||
key = hashlib.md5("".join(serialise)).hexdigest()
|
key = hashlib.md5("".join(serialise)).hexdigest()
|
||||||
|
|
|
@ -68,7 +68,7 @@ class Satellite(models.Model):
|
||||||
tle2 = models.CharField(max_length=200, blank=True)
|
tle2 = models.CharField(max_length=200, blank=True)
|
||||||
tle_source = models.CharField(max_length=300, blank=True)
|
tle_source = models.CharField(max_length=300, blank=True)
|
||||||
status = models.CharField(
|
status = models.CharField(
|
||||||
choices=zip(SATELLITE_STATUS, SATELLITE_STATUS), max_length=10, default='alive'
|
choices=list(zip(SATELLITE_STATUS, SATELLITE_STATUS)), max_length=10, default='alive'
|
||||||
)
|
)
|
||||||
decayed = models.DateTimeField(null=True, blank=True)
|
decayed = models.DateTimeField(null=True, blank=True)
|
||||||
|
|
||||||
|
@ -112,10 +112,10 @@ class TransmitterEntry(models.Model):
|
||||||
uuid = ShortUUIDField(db_index=True)
|
uuid = ShortUUIDField(db_index=True)
|
||||||
description = models.TextField()
|
description = models.TextField()
|
||||||
status = models.CharField(
|
status = models.CharField(
|
||||||
choices=zip(TRANSMITTER_STATUS, TRANSMITTER_STATUS), max_length=8, default='active'
|
choices=list(zip(TRANSMITTER_STATUS, TRANSMITTER_STATUS)), max_length=8, default='active'
|
||||||
)
|
)
|
||||||
type = models.CharField(
|
type = models.CharField(
|
||||||
choices=zip(TRANSMITTER_TYPE, TRANSMITTER_TYPE), max_length=11, default='Transmitter'
|
choices=list(zip(TRANSMITTER_TYPE, TRANSMITTER_TYPE)), max_length=11, default='Transmitter'
|
||||||
)
|
)
|
||||||
uplink_low = models.BigIntegerField(blank=True, null=True)
|
uplink_low = models.BigIntegerField(blank=True, null=True)
|
||||||
uplink_high = models.BigIntegerField(blank=True, null=True)
|
uplink_high = models.BigIntegerField(blank=True, null=True)
|
||||||
|
@ -205,7 +205,7 @@ class DemodData(models.Model):
|
||||||
TransmitterEntry, null=True, blank=True, on_delete=models.SET_NULL
|
TransmitterEntry, null=True, blank=True, on_delete=models.SET_NULL
|
||||||
)
|
)
|
||||||
app_source = models.CharField(
|
app_source = models.CharField(
|
||||||
choices=zip(DATA_SOURCES, DATA_SOURCES), max_length=7, default='sids'
|
choices=list(zip(DATA_SOURCES, DATA_SOURCES)), max_length=7, default='sids'
|
||||||
)
|
)
|
||||||
data_id = models.PositiveIntegerField(blank=True, null=True)
|
data_id = models.PositiveIntegerField(blank=True, null=True)
|
||||||
payload_frame = models.FileField(upload_to=_name_payload_frame, blank=True, null=True)
|
payload_frame = models.FileField(upload_to=_name_payload_frame, blank=True, null=True)
|
||||||
|
|
|
@ -65,7 +65,7 @@ def update_all_tle():
|
||||||
norad_ids = set(int(sat.norad_cat_id) for sat in satellites)
|
norad_ids = set(int(sat.norad_cat_id) for sat in satellites)
|
||||||
|
|
||||||
# Filter only officially announced NORAD IDs
|
# Filter only officially announced NORAD IDs
|
||||||
temporary_norad_ids = set(filter(lambda norad_id: norad_id >= 99900, norad_ids))
|
temporary_norad_ids = set([norad_id for norad_id in norad_ids if norad_id >= 99900])
|
||||||
public_norad_ids = norad_ids - temporary_norad_ids
|
public_norad_ids = norad_ids - temporary_norad_ids
|
||||||
|
|
||||||
tles = fetch_tles(public_norad_ids)
|
tles = fetch_tles(public_norad_ids)
|
||||||
|
@ -74,7 +74,7 @@ def update_all_tle():
|
||||||
for satellite in satellites:
|
for satellite in satellites:
|
||||||
norad_id = satellite.norad_cat_id
|
norad_id = satellite.norad_cat_id
|
||||||
|
|
||||||
if norad_id not in tles.keys():
|
if norad_id not in list(tles.keys()):
|
||||||
# No TLE available for this satellite
|
# No TLE available for this satellite
|
||||||
missing_norad_ids.append(norad_id)
|
missing_norad_ids.append(norad_id)
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -121,8 +121,8 @@ def calculate_statistics():
|
||||||
band_label.append('Ka')
|
band_label.append('Ka')
|
||||||
band_data.append(filtered)
|
band_data.append(filtered)
|
||||||
|
|
||||||
mode_data_sorted, mode_label_sorted = zip(*sorted(zip(mode_data, mode_label), reverse=True))
|
mode_data_sorted, mode_label_sorted = list(zip(*sorted(zip(mode_data, mode_label), reverse=True)))
|
||||||
band_data_sorted, band_label_sorted = zip(*sorted(zip(band_data, band_label), reverse=True))
|
band_data_sorted, band_label_sorted = list(zip(*sorted(zip(band_data, band_label), reverse=True)))
|
||||||
|
|
||||||
statistics = {
|
statistics = {
|
||||||
'total_satellites': total_satellites,
|
'total_satellites': total_satellites,
|
||||||
|
|
Loading…
Reference in New Issue