Skip to content

Commit f7294de

Browse files
authored
Remove locations (#108)
Upgrade all dependabot warnings AB#10634 Signed-off-by: Paul Hewlett <phewlett76@gmail.com>
1 parent b440d68 commit f7294de

31 files changed

Lines changed: 39 additions & 476 deletions

DEVELOPERS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ If TEST_VERBOSE is "-v" debugging output will appear when running the tests.
4646
## TEST_NAMESPACE
4747

4848
If TEST_NAMESPACE is blank or unspecified then each execution of './scripts/samples.sh' will not be
49-
independent. Any assets events, locations will be visible to other users running the same tests
49+
independent. Any assets or events will be visible to other users running the same tests
5050
on the same URL.
5151

52-
Each example test creates assets,events,locations that are not visible to other example tests.
52+
Each example test creates assets,events that are not visible to other example tests.
5353
For example the door_entry assets,events etc are not visible to the synsation example tests.
5454

55-
Assets and locations are only created if they do not already exist according to namespace.
55+
Assets are only created if they do not already exist according to namespace.
5656

5757
Due to restrictions attachments are always uploaded during every test execution.
5858

MANIFEST.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ graft archivist_samples/c2pa/c2pa_files
22
graft archivist_samples/document/document_files
33
graft archivist_samples/door_entry/images
44
graft archivist_samples/synsation/images
5-
graft archivist_samples/synsation/locations
65
graft archivist_samples/software_bill_of_materials/sbom_files
76
graft archivist_samples/sbom_document/sbom_files
87
graft archivist_samples/wipp/wipp_files

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ TEST_NAMESPACE is set to the date and time value in Unix format, thus providing
5757

5858
## TEST_NAMESPACE
5959

60-
If TEST_NAMESPACE is blank or unspecified, any assets events, locations will be visible to other users running the same examples
60+
If TEST_NAMESPACE is blank or unspecified, any assets or events will be visible to other users running the same examples
6161
on the same URL.
6262

63-
Each example creates assets,events,locations that are not visible to other examples.
63+
Each example creates assets,events that are not visible to other examples.
6464
For example the door_entry assets,events etc are not visible to the synsation example.
6565

66-
***Note: Assets and locations are only created if they do not already exist according to namespace. If one wants to execute a sample multiple
66+
***Note: Assets are only created if they do not already exist according to namespace. If one wants to execute a sample multiple
6767
times, feel free to set TEST_NAMESPACE to a different unique id.***
6868

6969
Due to restrictions attachments are always uploaded during every example execution.

archivist_samples/c2pa/c2pa.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
# pylint:disable=missing-module-docstring # docstrings
33
# pylint:disable=missing-class-docstring # docstrings
44

5-
try:
6-
# Python < 3.9
7-
import importlib_resources as res
8-
except ImportError:
9-
import importlib.resources as res
5+
import importlib.resources as res
106

117
import logging
128

archivist_samples/document/document.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
# pylint:disable=missing-class-docstring # docstrings
44
# pylint:disable=too-many-positional-arguments
55

6-
try:
7-
# Python < 3.9
8-
import importlib_resources as res
9-
except ImportError:
10-
import importlib.resources as res
6+
import importlib.resources as res
117

128
import logging
139

archivist_samples/door_entry/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def main():
4141
dest="create_assets",
4242
action="store_true",
4343
default=False,
44-
help="create the locations and assets. DO THIS ONLY ONCE.",
44+
help="create the assets. DO THIS ONLY ONCE.",
4545
)
4646
operations.add_argument(
4747
"-l",

archivist_samples/door_entry/run.py

Lines changed: 2 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22

33
# pylint: disable=missing-docstring
44

5-
6-
try:
7-
# Python < 3.9
8-
import importlib_resources as res
9-
except ImportError:
10-
import importlib.resources as res
5+
import importlib.resources as res
116

127
from copy import copy
138
import logging
@@ -71,18 +66,6 @@ def create_datatrails_paris(doors):
7166
),
7267
"wavestone_asset_id": "paris.france.datatrails.das",
7368
},
74-
location={
75-
"props": {
76-
"display_name": "DataTrails Paris",
77-
"description": "Sales and sales support for the French region",
78-
"latitude": 48.8339211,
79-
"longitude": 2.371345,
80-
},
81-
"attrs": {
82-
"address": "5 Parvis Alan Turing, 75013 Paris, France",
83-
"wavestone_ext": "managed",
84-
},
85-
},
8669
attachments=[
8770
AttachmentDescription("entry_terminal.jpg", "arc_primary_image"),
8871
],
@@ -102,18 +85,6 @@ def create_cityhall(doors):
10285
),
10386
"wavestone_asset_id": "cityhall.paris.wavestonedas",
10487
},
105-
location={
106-
"props": {
107-
"display_name": "Paris City Hall",
108-
"description": "Seat of Paris local city adminstration",
109-
"latitude": 48.856389,
110-
"longitude": 2.352222,
111-
},
112-
"attrs": {
113-
"address": "Place de l'Hôtel de Ville, 75004 Paris, France",
114-
"wavestone_ext": "managed",
115-
},
116-
},
11788
attachments=[
11889
AttachmentDescription("cityhall.jpg", "arc_primary_image"),
11990
],
@@ -133,18 +104,6 @@ def create_courts(doors):
133104
),
134105
"wavestone_asset_id": "courts.paris.wavestonedas",
135106
},
136-
location={
137-
"props": {
138-
"display_name": "Paris Courts of Justice",
139-
"description": ("Public museum in the former Palais de Justice"),
140-
"latitude": 48.855722,
141-
"longitude": 2.345051,
142-
},
143-
"attrs": {
144-
"address": "10 Boulevard du Palais, 75001 Paris, France",
145-
"wavestone_ext": "managed",
146-
},
147-
},
148107
attachments=[
149108
AttachmentDescription("courts.jpg", "arc_primary_image"),
150109
],
@@ -164,20 +123,6 @@ def create_bastille(doors):
164123
),
165124
"wavestone_asset_id": "bastille.paris.wavestonedas",
166125
},
167-
location={
168-
"props": {
169-
"display_name": "Bastille",
170-
"description": (
171-
"Medieval fortress, made famous by the " "French Revolution"
172-
),
173-
"latitude": 48.85333,
174-
"longitude": 2.36917,
175-
},
176-
"attrs": {
177-
"address": "Place de la Bastille, 75011 Paris, France",
178-
"wavestone_ext": "managed",
179-
},
180-
},
181126
attachments=[
182127
AttachmentDescription("bastille.jpg", "arc_primary_image"),
183128
],
@@ -197,20 +142,6 @@ def create_gdn_front(doors):
197142
),
198143
"wavestone_asset_id": "front.gdn.paris.wavestonedas",
199144
},
200-
location={
201-
"props": {
202-
"display_name": "Apartements du Gare du Nord",
203-
"description": (
204-
"Residential apartment building in new complex " "above GdN station"
205-
),
206-
"latitude": 48.8809,
207-
"longitude": 2.3553,
208-
},
209-
"attrs": {
210-
"address": "18 Rue de Dunkerque, 75010 Paris, France",
211-
"wavestone_ext": "managed",
212-
},
213-
},
214145
attachments=[
215146
AttachmentDescription("gdn_front.jpg", "arc_primary_image"),
216147
],
@@ -230,20 +161,6 @@ def create_gdn_side(doors):
230161
),
231162
"wavestone_asset_id": "side.gdn.paris.wavestonedas",
232163
},
233-
location={
234-
"props": {
235-
"display_name": "Apartements du Gare du Nord",
236-
"description": (
237-
"Residential apartment building in new complex " "above GdN station"
238-
),
239-
"latitude": 48.8809,
240-
"longitude": 2.3553,
241-
},
242-
"attrs": {
243-
"address": "18 Rue de Dunkerque, 75010 Paris, France",
244-
"wavestone_ext": "managed",
245-
},
246-
},
247164
attachments=[
248165
AttachmentDescription("gdn_side.jpg", "arc_primary_image"),
249166
],
@@ -274,9 +191,8 @@ def create_doors(doors):
274191

275192
def create_cards(cards):
276193
LOGGER.info("Creating all cards...")
277-
# We don't create locations for cards - they float free.
278194
# If there's a natural affinity between cards and home
279-
# locations/owners in the real world then of course we
195+
# owners in the real world then of course we
280196
# can add this.
281197
# Similarly there's no real benefit to creating a
282198
# Primary_image for them so leave that empty too
@@ -320,13 +236,10 @@ def list_doors(doors):
320236
LOGGER.info("Listing all doors tracked by the system:")
321237
for door in doors.assets.list():
322238
attrs = door["attributes"]
323-
location = doors.locations.read(attrs["arc_home_location_identity"])
324239
attachments = find_attachment_attributes(attrs)
325240

326241
print(f"\tAsset name:\t{attrs['arc_display_name']}")
327242
print(f"\tAsset type:\t{attrs['arc_display_type']}")
328-
print(f"\tAsset location:\t{location['display_name']}")
329-
print(f"\tAsset address:\t{location['attributes']['address']}")
330243
print(f"\tArchivist ID:\t{door['identity']}")
331244
for a in attachments:
332245
print(f"\tAttachment identity: \t{a['arc_blob_identity']}")
@@ -460,12 +373,6 @@ def open_door(doors, doorid, cards, cardid):
460373
wsext_door_wsid = door["attributes"]["wavestone_asset_id"]
461374
corval = str(uuid.uuid4())
462375

463-
# Work out where we are
464-
location = doors.locations.read(door["attributes"]["arc_home_location_identity"])
465-
if not location:
466-
LOGGER.error("Door location is missing")
467-
return
468-
469376
# Capture a picture of the building entrance
470377
# In this example we just dig out the main image of the building
471378
# but the principle here is that the operative could snap it from
@@ -554,14 +461,6 @@ def open_door(doors, doorid, cards, cardid):
554461
"arc_display_type": "Door Open",
555462
"arc_evidence": "ARQC: 0x12345678",
556463
"arc_correlation_value": corval,
557-
# Events take optional GIS coordinates to record where
558-
# they happened and trace movements. In this case things
559-
# are very simple - we just record the fixed location of
560-
# the door being opened - but it can be used for any
561-
# mobile asset such as a self-driving car, a drone, or a
562-
# container in supply chain events
563-
"arc_gis_lat": f"{location['latitude']}",
564-
"arc_gis_lng": f"{location['longitude']}",
565464
"wavestone_door_name": wsext_doorname,
566465
"wavestone_door_archivist_id": door["identity"],
567466
"wavestone_evt_type": "door_open",

archivist_samples/estate_info/main.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def run(poc, args):
2929
if args.quick_count:
3030
LOGGER.info("Number of events is %d", poc.events.count())
3131
LOGGER.info("Number of assets is %d", poc.assets.count())
32-
LOGGER.info("Number of locations is %d", poc.locations.count())
3332
return 0
3433

3534
if args.double_check:
@@ -61,16 +60,14 @@ def run(poc, args):
6160

6261
num_events = poc.events.count()
6362
num_assets = poc.assets.count()
64-
num_locations = poc.locations.count()
6563

6664
LOGGER.info(
6765
(
6866
"There are %s events registered against %s assets"
69-
" in the system spread over %s locations."
67+
" in the system spread."
7068
),
7169
num_events,
7270
num_assets,
73-
num_locations,
7471
)
7572

7673
LOGGER.info("Performing double-check... FINISH")

archivist_samples/sample_scripts/c2pa/c2pa_verify.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@
2323

2424
import sample
2525

26-
try:
27-
# Python < 3.9
28-
import importlib_resources as res
29-
except ImportError:
30-
import importlib.resources as res
26+
import importlib.resources as res
3127

3228

3329
# DataTrails Connection Parameters -- Honest Abe

archivist_samples/sbom_document/software_package.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
# pylint:disable=unused-import # To prevent cyclical import errors forward referencing is used
55
# pylint:disable=cyclic-import # but pylint doesn't understand this feature
66

7-
try:
8-
# Python < 3.9
9-
import importlib_resources as res
10-
except ImportError:
11-
import importlib.resources as res
7+
import importlib.resources as res
128

139
import logging
1410
from sys import exit as sys_exit

0 commit comments

Comments
 (0)