Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 4 additions & 27 deletions src/extensions/score_draw_uml_funcs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@
which then can be invoked inside 'needarch' and 'needuml' blocks in rst files.
"""

import hashlib
import time
from collections.abc import Callable
from functools import cache
from pathlib import Path
from typing import Any, cast

from score_draw_uml_funcs.draw_helpers import (
Expand Down Expand Up @@ -69,25 +65,6 @@ def setup(app: Sphinx) -> dict[str, object]:
}


@cache
def scripts_directory_hash():
start = time.time()
all = ""
for file in Path(".devcontainer/sphinx_conf").glob("**/*.py"):
with open(file) as f:
all += f.read()
hash_object = hashlib.sha256(all.encode("utf-8"))
directory_hash = hash_object.hexdigest()
logger.info(
"calculate directory_hash = "
+ directory_hash
+ " within "
+ str(time.time() - start)
+ " seconds."
)
return directory_hash


# โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
# โ”‚ Actual drawing functions โ”‚
# โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Expand Down Expand Up @@ -433,7 +410,7 @@ def _resolve_component_for_view(

class draw_full_feature:
def __repr__(self):
return "draw_full_feature" + " in " + scripts_directory_hash()
return "draw_full_feature"

def _collect_interfaces_and_modules(
self,
Expand Down Expand Up @@ -587,7 +564,7 @@ def __call__(

class draw_full_module:
def __repr__(self):
return "draw_full_module" + " in " + scripts_directory_hash()
return "draw_full_module"

def __call__(
self, need: dict[str, str], all_needs: dict[str, dict[str, str]]
Expand All @@ -604,7 +581,7 @@ def __call__(

class draw_full_component:
def __repr__(self):
return "draw_full_component" + " in " + scripts_directory_hash()
return "draw_full_component"

def __call__(
self, need: dict[str, str], all_needs: dict[str, dict[str, str]]
Expand All @@ -631,7 +608,7 @@ def __call__(

class draw_full_interface:
def __repr__(self):
return "draw_full_interface" + " in " + scripts_directory_hash()
return "draw_full_interface"

def __call__(
self, need: dict[str, str], all_needs: dict[str, dict[str, str]]
Expand Down
Loading