Commit 892e703b authored by w-e-w's avatar w-e-w

webpath use truncate_path

parent af2951ed
import os
import gradio as gr
from modules import localization, shared, scripts
from modules.paths import script_path, data_path, cwd
from modules import localization, shared, scripts, util
from modules.paths import script_path, data_path
def webpath(fn):
if fn.startswith(cwd):
web_path = os.path.relpath(fn, cwd)
else:
web_path = os.path.abspath(fn)
return f'file={web_path}?{os.path.getmtime(fn)}'
return f'file={util.truncate_path(fn)}?{os.path.getmtime(fn)}'
def javascript_html():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment