Compare commits

...

3 commits

Author SHA1 Message Date
j
c43ccd319d update to python 3.6 2018-04-08 15:46:57 +05:30
j
ee586ee194 use gio open if available 2017-10-08 12:55:53 +02:00
j
216b880151 space 2017-08-31 19:46:14 +02:00
4 changed files with 22 additions and 12 deletions

View file

@ -36,9 +36,9 @@ To update to latest version:
./ctl update
On Linux you need a working python3.4 installation with pillow, python-lxml, pyOpenSSL and pyCrypto and popler-utils:
On Linux you need a working python3.6 installation with pillow, python-lxml, pyOpenSSL and pyCrypto and popler-utils:
apt-get install python3.4 python3-pil python3-lxml \
apt-get install python3.6 python3-pil python3-lxml \
python3-openssl python3-crypto poppler-utils \
libevent-2.0-5
@ -46,7 +46,7 @@ Platform
----------
If you install Open Media Library on a architecture/os that is currently
not supported, you need a working python 3.4 installation and the dependencies
not supported, you need a working python 3.6 installation and the dependencies
listed in requirements.txt and requirements-shared.txt:
pip3 install -r requirements.txt

6
ctl
View file

@ -147,7 +147,11 @@ if [ "$1" == "open" ]; then
if [ $SYSTEM == "Linux" ]; then
if [ -e "$PID" ]; then
if ps -p `cat "$PID"` > /dev/null; then
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
if [ -e /usr/bin/gio ]; then
gio open "file://${BASE}/openmedialibrary/static/html/load.html"
else
xdg-open "file://${BASE}/openmedialibrary/static/html/load.html"
fi
else
$PYTHON "${NAME}/oml/gtkstatus.py" $@
exit $?

View file

@ -38,13 +38,13 @@ def json_dumps(obj):
return json.dumps(obj, indent=indent, default=_to_json, ensure_ascii=False).encode()
def run_async(func):
@wraps(func)
def async_func(*args, **kwargs):
func_hl = Thread(target = func, args = args, kwargs = kwargs)
func_hl.start()
return func_hl
@wraps(func)
def async_func(*args, **kwargs):
func_hl = Thread(target=func, args=args, kwargs=kwargs)
func_hl.start()
return func_hl
return async_func
return async_func
def trim(docstring):
if not docstring:

View file

@ -264,7 +264,10 @@ def open_file(path=None):
if sys.platform == 'darwin':
cmd += ['open', path]
elif sys.platform.startswith('linux'):
cmd += ['xdg-open', path]
if os.path.exists('/usr/bin/gio'):
cmd += ['gio', 'open', path]
else:
cmd += ['xdg-open', path]
elif sys.platform == 'win32':
path = '\\'.join(path.split('/'))
os.startfile(path)
@ -285,7 +288,10 @@ def open_folder(folder=None, path=None):
path = folder
cmd += ['open', '-R', path]
elif sys.platform.startswith('linux'):
cmd += ['xdg-open', folder]
if os.path.exists('/usr/bin/gio'):
cmd += ['gio', 'open', folder]
else:
cmd += ['xdg-open', folder]
elif sys.platform == 'win32':
path = '\\'.join(path.split('/'))
cmd = 'explorer.exe /select,"%s"' % path