File size: 416 Bytes
e92e659
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from etils import epath
import streamlit as st

from core.state import CurrentProject


def get_resource_path(content_url: str) -> epath.Path:
    """Gets the path on disk of the resource with `content_url`."""
    project: CurrentProject = st.session_state[CurrentProject]
    path = project.path / content_url
    if not path.parent.exists():
        path.parent.mkdir(parents=True, exist_ok=True)
    return path