diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:22:46 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-03-05 19:22:46 +0100 |
commit | af81318ae9311fd0b0e16949cef3cfaf7996970b (patch) | |
tree | fb220da28bb7248ebf37ce09af5de88f2c1aaad4 /bsie/lib | |
parent | 7bf6b33fa6d6b901e4933bfe0b2a9939d7b3f3f3 (diff) | |
parent | 8b460aa0232cd841af7b7734c91982bc83486e03 (diff) | |
download | bsie-af81318ae9311fd0b0e16949cef3cfaf7996970b.tar.gz bsie-af81318ae9311fd0b0e16949cef3cfaf7996970b.tar.bz2 bsie-af81318ae9311fd0b0e16949cef3cfaf7996970b.zip |
Merge branch 'mb/diogenes' into develop
Diffstat (limited to 'bsie/lib')
-rw-r--r-- | bsie/lib/__init__.py | 5 | ||||
-rw-r--r-- | bsie/lib/bsie.py | 5 | ||||
-rw-r--r-- | bsie/lib/builder.py | 5 | ||||
-rw-r--r-- | bsie/lib/naming_policy.py | 13 | ||||
-rw-r--r-- | bsie/lib/pipeline.py | 7 |
5 files changed, 5 insertions, 30 deletions
diff --git a/bsie/lib/__init__.py b/bsie/lib/__init__.py index 48379de..f44fb74 100644 --- a/bsie/lib/__init__.py +++ b/bsie/lib/__init__.py @@ -1,9 +1,4 @@ -""" -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # standard imports import typing diff --git a/bsie/lib/bsie.py b/bsie/lib/bsie.py index a572525..b02e707 100644 --- a/bsie/lib/bsie.py +++ b/bsie/lib/bsie.py @@ -1,9 +1,4 @@ -""" -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # standard imports import typing diff --git a/bsie/lib/builder.py b/bsie/lib/builder.py index 39da441..3a15311 100644 --- a/bsie/lib/builder.py +++ b/bsie/lib/builder.py @@ -1,9 +1,4 @@ -""" -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # standard imports import logging import typing diff --git a/bsie/lib/naming_policy.py b/bsie/lib/naming_policy.py index 131a70b..9b9a45d 100644 --- a/bsie/lib/naming_policy.py +++ b/bsie/lib/naming_policy.py @@ -1,9 +1,4 @@ -""" -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # standard imports import abc import os @@ -85,9 +80,9 @@ class DefaultNamingPolicy(NamingPolicy): def handle_node(self, node: Node) -> Node: if node.uri is not None: return node - if node.node_type == ns.bsfs.File: + if node.node_type == ns.bsn.Entity : return self.name_file(node) - if node.node_type == ns.bsfs.Preview: + if node.node_type == ns.bsn.Preview: return self.name_preview(node) raise errors.ProgrammingError('no naming policy available for {node.node_type}') @@ -97,7 +92,7 @@ class DefaultNamingPolicy(NamingPolicy): fragment = node.hints['ucid'] else: # random name fragment = self._uuid() - node.uri = (self._prefix + 'file')[fragment] + node.uri = getattr(self._prefix.file(), fragment) return node def name_preview(self, node: Node) -> Node: @@ -114,7 +109,7 @@ class DefaultNamingPolicy(NamingPolicy): fragment = self._uuid() if 'size' in node.hints: # append size fragment += '_s' + str(node.hints['size']) - node.uri = (self._prefix + 'preview')[fragment] + node.uri = getattr(self._prefix.preview(), fragment) return node ## EOF ## diff --git a/bsie/lib/pipeline.py b/bsie/lib/pipeline.py index 0bc5109..30fd6fd 100644 --- a/bsie/lib/pipeline.py +++ b/bsie/lib/pipeline.py @@ -1,9 +1,4 @@ -""" -Part of the bsie module. -A copy of the license is provided with the project. -Author: Matthias Baumgartner, 2022 -""" # standard imports from collections import defaultdict import logging @@ -109,7 +104,7 @@ class Pipeline(): rdr2ext[rdr].add(ext) # create subject for file - subject = node.Node(ns.bsfs.File, + subject = node.Node(ns.bsn.Entity, ucid=bsfs.uuid.UCID.from_path(path), ) |