diff --git a/nullptr/atlas_builder.py b/nullptr/atlas_builder.py index d8c201f..7d91116 100644 --- a/nullptr/atlas_builder.py +++ b/nullptr/atlas_builder.py @@ -28,6 +28,8 @@ class AtlasBuilder: for w in waypoints: if self.stop_auto: break + if 'UNCHARTED' in w.traits: + continue if 'MARKETPLACE' in w.traits: self.api.marketplace(w) print(f'marketplace at {w}') diff --git a/nullptr/store.py b/nullptr/store.py index 194e276..c15fc00 100644 --- a/nullptr/store.py +++ b/nullptr/store.py @@ -30,6 +30,20 @@ class Store: data['store'] = self obj.__dict__ = data + def get_file(self, typ, path): + if not isfile(path): + return None + with open(path) as f: + data = json.load(f) + symbol = mg(data, 'symbol') + oid = f'{symbol}.{typ.ext()}' + if oid in self.data: + return self.data[oid] + obj = typ(symbol, self) + self.load(obj) + self.data[oid] = obj + return obj + def store(self, obj): path = self.path(obj) path_dir = dirname(path) @@ -69,8 +83,7 @@ class Store: continue if not fil.endswith(ext): continue - symbol = f[:-len(ext)] - yield self.get(typ, symbol) + yield self.get_file(typ, fil) def flush(self): @@ -81,4 +94,4 @@ class Store: self.store(obj) self.dirty_objects = set() dur = time() - start_time - print(f'flush done {it} items {dur:.2f}') + # print(f'flush done {it} items {dur:.2f}')