优化打包脚本; load方法支持http远程地址
parent
c885d72b8f
commit
d499991831
|
@ -1,2 +1,3 @@
|
||||||
__pycache__
|
__pycache__
|
||||||
|
unpack
|
||||||
*.deb
|
*.deb
|
1
build.sh
1
build.sh
|
@ -7,6 +7,7 @@ if [ -d unpack ]; then
|
||||||
sudo rm -rf unpack
|
sudo rm -rf unpack
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
find usr -type d -name __pycache__ | xargs rm -rf
|
||||||
|
|
||||||
mkdir -p unpack/DEBIAN
|
mkdir -p unpack/DEBIAN
|
||||||
|
|
||||||
|
|
|
@ -125,10 +125,13 @@ class WebEngine(WebKit2.WebView):
|
||||||
|
|
||||||
|
|
||||||
def load(self, url = '/index.html'):
|
def load(self, url = '/index.html'):
|
||||||
if self.root is None:
|
if url.startswith('http:') or url.startswith('https:'):
|
||||||
raise EnvironmentError('web root dir not set!')
|
self.load_uri(url)
|
||||||
else:
|
else:
|
||||||
self.load_uri(f"app://{url}")
|
if self.root is None:
|
||||||
|
raise EnvironmentError('web root dir not set!')
|
||||||
|
else:
|
||||||
|
self.load_uri(f"app://{url}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue