kopia lustrzana https://github.com/glidernet/ogn-python
Fix bulkimport
rodzic
bad47bdff6
commit
32b6150728
|
@ -36,7 +36,7 @@ def convert(sourcefile, path=''):
|
||||||
match = re.search('^.+\.txt\_(\d{4}\-\d{2}\-\d{2})(\.gz)?$', sourcefile)
|
match = re.search('^.+\.txt\_(\d{4}\-\d{2}\-\d{2})(\.gz)?$', sourcefile)
|
||||||
if match:
|
if match:
|
||||||
reference_date_string = match.group(1)
|
reference_date_string = match.group(1)
|
||||||
reference_date = datetime.strptime(reference_date_string, "%Y-%m-%d")
|
reference_date = datetime.datetime.strptime(reference_date_string, "%Y-%m-%d")
|
||||||
else:
|
else:
|
||||||
print("filename '{}' does not match pattern. Skipping".format(sourcefile))
|
print("filename '{}' does not match pattern. Skipping".format(sourcefile))
|
||||||
return
|
return
|
||||||
|
|
|
@ -94,7 +94,7 @@ class AircraftBeacon(Beacon):
|
||||||
def get_csv_values(self):
|
def get_csv_values(self):
|
||||||
return [
|
return [
|
||||||
self.location_wkt,
|
self.location_wkt,
|
||||||
int(self.altitude),
|
int(self.altitude) if self.altitude else None,
|
||||||
self.name,
|
self.name,
|
||||||
self.receiver_name,
|
self.receiver_name,
|
||||||
self.timestamp,
|
self.timestamp,
|
||||||
|
|
Ładowanie…
Reference in New Issue