diff --git a/README.md b/README.md index 4c45e52..886439c 100644 --- a/README.md +++ b/README.md @@ -29,17 +29,17 @@ Using this framework, you can use PyQt develop powerful graphics programs to ext 1. Install python libraries: ```Bash -sudo pacman -S python-xlib python-pyqt5 python-pymediainfo -sudo pip install PyMuPDF grip +sudo pacman -S python-xlib python-pyqt5 +sudo pip install PyMuPDF grip qrcode ``` -| Package | Use for | -| :-------- | :---- | -| python-xlib | Stick app window into emacs frame | -| python-pyqt5 | GUI library required for application development | -| python-pymediainfo | Detect file type, then choose the right application to open | -| PyMuPDF | Render engine required for PDF Viewer | -| grip | Markdown render server for Markdown Previewer | +| Package | Use for | +| :-------- | :---- | +| python-xlib | Stick app window into emacs frame | +| python-pyqt5 | GUI library required for application development | +| PyMuPDF | Render engine required for PDF Viewer | +| grip | Markdown render server for Markdown Previewer | +| qrcode | Render local file QR code | 2. Clone this repository and add below code in your ~/.emacs ```Elisp diff --git a/eaf.el b/eaf.el index 3866414..a22d705 100644 --- a/eaf.el +++ b/eaf.el @@ -138,7 +138,7 @@ (apply 'start-process eaf-name eaf-name - "python" (append (list eaf-python-file (eaf-get-emacs-xid)) (eaf-get-render-size)) + "python3" (append (list eaf-python-file (eaf-get-emacs-xid)) (eaf-get-render-size)) )) (set-process-query-on-exit-flag eaf-process nil) (set-process-sentinel diff --git a/eaf.py b/eaf.py index 19ab13a..66d6019 100755 --- a/eaf.py +++ b/eaf.py @@ -24,7 +24,6 @@ from core.fake_key_event import fake_key_event from core.utils import file_is_image, file_is_video from core.view import View from dbus.mainloop.glib import DBusGMainLoop -from pymediainfo import MediaInfo import importlib import dbus import dbus.service @@ -55,12 +54,12 @@ class EAF(dbus.service.Object): return self.create_app(buffer_id, str(url), "app.{0}.buffer".format(str(app_name))) def create_app(self, buffer_id, url, module_path): - if importlib.util.find_spec(module_path) is not None: + try: module = importlib.import_module(module_path) self.create_buffer(buffer_id, module.AppBuffer(buffer_id, url)) return "" - else: + except ImportError: return "Something wrong when import {0}".format(module_path) def create_buffer(self, buffer_id, app_buffer):