Skip to content

Commit

Permalink
Working on code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
mesemus committed Dec 16, 2023
1 parent 0bc8cd2 commit 47087e3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
1 change: 0 additions & 1 deletion oarepo_ui/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def _catalog_config(self, catalog, env):
catalog.jinja_env.filters.update(env.filters)
catalog.jinja_env.policies.update(env.policies)

# env.loader.searchpath = list_templates(catalog.jinja_env)
catalog.prefixes[""] = catalog.jinja_env.loader

return catalog
Expand Down
27 changes: 0 additions & 27 deletions oarepo_ui/resources/catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,23 +105,6 @@ def _get_component_path(

raise ComponentNotFound(f"Unable to find a file named {name}")

def _get_from_file(
self, *, prefix: str, name: str, url_prefix: str, file_ext: str
) -> "Component":
return super()._get_from_file(
prefix=prefix, name=name, url_prefix=url_prefix, file_ext=file_ext
)
root_path, path = self._get_component_path(prefix, name, file_ext=file_ext)
component = Component(
name=name,
url_prefix=url_prefix,
path=path,
)
tmpl_name = str(path.relative_to(root_path))

component.tmpl = self.jinja_env.get_template(tmpl_name)
return component

def list_templates(self):
searchpath = []

Expand Down Expand Up @@ -149,16 +132,6 @@ def list_templates(self):
return searchpath


def lazy_string_encoder(obj):
if isinstance(obj, list):
return [lazy_string_encoder(item) for item in obj]
elif isinstance(obj, dict):
return {key: lazy_string_encoder(value) for key, value in obj.items()}
else:
return str(obj)



def strip_app_theme(template_name, app_theme):
if app_theme:
for theme in app_theme:
Expand Down

0 comments on commit 47087e3

Please sign in to comment.