Skip to content

Commit

Permalink
Add SDFLoader.load_from_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
christiansandberg committed Oct 14, 2024
1 parent 64e1366 commit 15ed3dc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions onedm/sdf/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ def load_from_fp(self, fp: io.TextIOBase):
self.root = json.load(fp)
self._dereference(self.root)

def load_from_dict(self, doc: dict, url: str = ""):
self.url = url
self.root = doc
self._dereference(self.root)

def load(self, url: str):
result = urllib.parse.urlparse(url)
if not result.scheme:
Expand Down

0 comments on commit 15ed3dc

Please sign in to comment.