-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22db26d
commit ecd975a
Showing
5 changed files
with
5 additions
and
19 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Ricardo Garcia Silva <[email protected]> | ||
# | ||
# Copyright (c) 2023 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2016 James F. Dickens | ||
# Copyright (c) 2017 Ricardo Garcia Silva | ||
# | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Angelos Tzotsos <[email protected]> | ||
# | ||
# Copyright (c) 2024 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2021 Angelos Tzotsos | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
|
@@ -901,8 +901,6 @@ def item(self, headers_, args, collection, item): | |
if 'json' in headers_['Content-Type']: | ||
headers_['Content-Type'] = 'application/geo+json' | ||
|
||
print("RESPONSE", response) | ||
|
||
return self.get_response(200, headers_, response, 'item.html') | ||
|
||
def manage_collection_item(self, headers_, action='create', item=None, data=None): | ||
|
@@ -1368,8 +1366,6 @@ def record2json(record, url, collection, mode='ogcapi-records'): | |
if record.time_begin not in [None, '']: | ||
begin, _ = to_rfc3339(record.time_begin) | ||
end, _ = to_rfc3339(record.time_end) | ||
print("BEFORE", record.time_begin, record.time_end) | ||
print("AFTER", begin, end) | ||
record_dict['time'] = { | ||
'interval': [begin, end] | ||
} | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Angelos Tzotsos <[email protected]> | ||
# | ||
# Copyright (c) 2024 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2021 Angelos Tzotsos | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
|
@@ -91,13 +91,9 @@ def json_serial(obj): | |
""" | ||
|
||
if isinstance(obj, (datetime, date, time)): | ||
print("1", obj) | ||
print("1", type(obj)) | ||
if isinstance(obj, (datetime, time)): | ||
print("DATETIME", obj) | ||
return obj.strftime('%Y-%m-%dT%H:%M:%SZ') | ||
else: # date | ||
print("DATE", obj) | ||
return obj.strftime('%Y-%m-%d') | ||
elif isinstance(obj, bytes): | ||
try: | ||
|
@@ -241,7 +237,6 @@ def to_rfc3339(value: str) -> Union[tuple, None]: | |
:returns: `tuple` of `datetime` of RFC3339 value and date type | ||
""" | ||
|
||
print("VALUE", value) | ||
try: | ||
dt = dparse(value) # TODO TIMEZONE) | ||
except Exception as err: | ||
|
@@ -255,7 +250,4 @@ def to_rfc3339(value: str) -> Union[tuple, None]: | |
dt_type = 'date-time' | ||
dt_type = 'date-time' | ||
|
||
|
||
print("DT", dt) | ||
print("DT_TYPE", dt_type) | ||
return dt, dt_type |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# | ||
# Authors: Tom Kralidis <[email protected]> | ||
# | ||
# Copyright (c) 2024 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
# obtaining a copy of this software and associated documentation | ||
|
@@ -460,7 +460,6 @@ def item(self, headers_, args, collection, item): | |
headers_['Accept'] = 'application/geo+json' | ||
headers, status, response = super().item(headers_, args, collection, item) | ||
|
||
print("TOM", response) | ||
if collection not in self.get_all_collections(): | ||
msg = 'Invalid collection' | ||
LOGGER.exception(msg) | ||
|
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
# Authors: Tom Kralidis <[email protected]> | ||
# Angelos Tzotsos <[email protected]> | ||
# | ||
# Copyright (c) 2023 Tom Kralidis | ||
# Copyright (c) 2025 Tom Kralidis | ||
# Copyright (c) 2022 Angelos Tzotsos | ||
# | ||
# Permission is hereby granted, free of charge, to any person | ||
|
@@ -270,7 +270,6 @@ def test_json_transaction(config, sample_collection, sample_item, | |
content = json.loads(api.item({}, {}, 'metadata:main', | ||
'20201211_223832_CS2')[2]) | ||
|
||
print("JJJ22222", content) | ||
assert content['id'] == '20201211_223832_CS2' | ||
assert content['properties']['datetime'] == sample_item['properties']['datetime'] | ||
assert content['collection'] == 'metadata:main' | ||
|