From 216b880151554b27f49ee8c7d62f97d928d58727 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 31 Aug 2017 19:46:14 +0200 Subject: [PATCH 1/3] space --- oml/oxtornado.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/oml/oxtornado.py b/oml/oxtornado.py index db15793..322c6a8 100644 --- a/oml/oxtornado.py +++ b/oml/oxtornado.py @@ -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: From ee586ee194ecf01c855d57db984fe7442e8f1880 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 8 Oct 2017 12:55:53 +0200 Subject: [PATCH 2/3] use gio open if available --- ctl | 6 +++++- oml/utils.py | 10 ++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ctl b/ctl index a7e8b6f..f02ceeb 100755 --- a/ctl +++ b/ctl @@ -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 $? diff --git a/oml/utils.py b/oml/utils.py index a3463f4..50e2e9e 100644 --- a/oml/utils.py +++ b/oml/utils.py @@ -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 From c43ccd319dc6f38bcfb9b8dd46d3be58cd5b510e Mon Sep 17 00:00:00 2001 From: j Date: Sun, 8 Apr 2018 15:46:57 +0530 Subject: [PATCH 3/3] update to python 3.6 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3eb0d64..0c94025 100644 --- a/README.md +++ b/README.md @@ -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