aboutsummaryrefslogtreecommitdiff
path: root/src/ee/xml
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2019-05-15 22:08:37 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2019-05-24 07:57:00 +0200
commit4afac7dc4c743284e5243428f00928aa7eaacfdc (patch)
treed2e65dbced03e310e15509a239eb096f41d047f4 /src/ee/xml
parentd8b6719c628c7dfb4537ad2303c016884e9312f3 (diff)
downloadee-python-4afac7dc4c743284e5243428f00928aa7eaacfdc.tar.gz
ee-python-4afac7dc4c743284e5243428f00928aa7eaacfdc.tar.bz2
ee-python-4afac7dc4c743284e5243428f00928aa7eaacfdc.tar.xz
ee-python-4afac7dc4c743284e5243428f00928aa7eaacfdc.zip
ee.project: Making sure all projects have an UUID.
kicad-make-bom: Using the project's UUID to generate an URL for all parts.
Diffstat (limited to 'src/ee/xml')
-rw-r--r--src/ee/xml/uris.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ee/xml/uris.py b/src/ee/xml/uris.py
index bb961df..355df83 100644
--- a/src/ee/xml/uris.py
+++ b/src/ee/xml/uris.py
@@ -1,4 +1,5 @@
-from typing import Optional
+import uuid
+from typing import Optional, Union
# Values for `..#ee-component-type` facts
CAPACITOR = "http://purl.org/ee/part-type#capacitor"
@@ -32,3 +33,7 @@ _FACT_KEY_PREFIX = "http://purl.org/trygvis/ee/fact-key#"
def make_fact_key(name: str) -> str:
return "{}{}".format(_FACT_KEY_PREFIX, name)
+
+
+def make_schematic_part_uri(project: Union[str, uuid.UUID], schematic_reference: str) -> str:
+ return "http://purl.org/trygvis/ee/project/{}#{}".format(project, schematic_reference)