bsie.lib.naming_policy module#

class bsie.lib.naming_policy.DefaultNamingPolicy(host: URI, user: str)#

Bases: NamingPolicy

Compose URIs as <host/user/node_type#fragment>

What information is used as fragment depends on the node type. Typically, the default is to use the “ucid” hint. The fallback in all cases is to generate a random uuid.

Never changes previously assigned uris. Sets uris in-place.

handle_node(node: Node) Node#

Apply the policy on a node.

name_file(node: Node) Node#

Set a bsfs:File node’s uri fragment to its ucid.

name_preview(node: Node) Node#

Set a bsfs:Preview node’s uri fragment to its ucid. Uses its source fragment as fallback. Appends the size if provided.