diff options
author | Alejandro Gallo <aamsgallo@gmail.com> | 2018-11-30 19:20:38 +0100 |
---|---|---|
committer | Alejandro Gallo <aamsgallo@gmail.com> | 2018-11-30 19:20:38 +0100 |
commit | 234744299487c724e27bea9e89fa942ac6323a07 (patch) | |
tree | f2fbc579bd820806ccff619c8f74cd10a97fb66d | |
parent | 057754db2633d14710bcb05c07dbfeb237328cf8 (diff) |
Erase dmenu from papis main repository
-rw-r--r-- | papis/gui/__init__.py | 53 | ||||
-rw-r--r-- | papis/gui/dmenu.py | 49 | ||||
-rw-r--r-- | setup.py | 1 |
3 files changed, 0 insertions, 103 deletions
diff --git a/papis/gui/__init__.py b/papis/gui/__init__.py index dc55d496..86ed8d8b 100644 --- a/papis/gui/__init__.py +++ b/papis/gui/__init__.py @@ -29,48 +29,6 @@ Vim gui .. papis-config:: header-format :section: vim-gui -dmenu gui -********* - -See `dmenu <https://tools.suckless.org/dmenu/>`_ and the python wrapper -`here <http://dmenu.readthedocs.io/en/latest/>`_ for more information. -You will need to install the latter to make use of this function, - -:: - - pip3 install dmenu - - -.. papis-config:: lines - :section: dmenu-gui - -.. papis-config:: case_insensitive - :section: dmenu-gui - -.. papis-config:: bottom - :section: dmenu-gui - -.. papis-config:: font - :section: dmenu-gui - -.. papis-config:: background - :section: dmenu-gui - -.. papis-config:: foreground - :section: dmenu-gui - -.. papis-config:: background_selected - :section: dmenu-gui - -.. papis-config:: foreground_selected - :section: dmenu-gui - -.. papis-config:: header-format - :section: dmenu-gui - - This is not set per default, and it will default to - the general header-format if not set. - """ @@ -91,15 +49,4 @@ def get_default_settings(): "Year : {doc[year]}\n" "-------\n", }, - "dmenu-gui": { - "lines": 20, - "case_insensitive": True, - "bottom": True, - "font": 'monospace-14', - "background": '#000000', - "foreground": '#55ff55', - "background_selected": '#005500', - "foreground_selected": '#f0f0f0', - "header-format": None, - }, } diff --git a/papis/gui/dmenu.py b/papis/gui/dmenu.py deleted file mode 100644 index e0d94e49..00000000 --- a/papis/gui/dmenu.py +++ /dev/null @@ -1,49 +0,0 @@ -import sys - -try: - import dmenu -except: - print('You don\'t have dmenu for python, try pip3 install dmenu') - sys.exit(1) - -import papis.api -import papis.utils -import functools - - -_dmenu_pick = functools.partial( - dmenu.show, - case_insensitive=papis.config.getboolean( - 'case_insensitive', section="dmenu-gui" - ), - lines=papis.config.getint('lines', section='dmenu-gui'), - bottom=papis.config.getboolean('bottom', section='dmenu-gui'), - font=papis.config.get('font', section='dmenu-gui'), - background=papis.config.get('background', section='dmenu-gui'), - foreground=papis.config.get('foreground', section='dmenu-gui'), - background_selected=papis.config.get( - 'background_selected', section='dmenu-gui' - ), - foreground_selected=papis.config.get( - 'foreground_selected', section='dmenu-gui' - ) -) - - -def pick(options, header_filter=None, body_filter=None, match_filter=None): - if header_filter is None: - fmt = papis.config.get('header-format', section='dmenu-gui') - if fmt is None: - fmt = papis.config.get('header-format') - - def header_filter(x): - return papis.utils.format_doc(fmt, x) - if len(options) == 1: - index = 0 - else: - headers = [header_filter(o) for o in options] - header = _dmenu_pick(headers) - if not header: - return None - index = headers.index(header) - return options[index] @@ -77,7 +77,6 @@ setup( # for example: # $ pip install -e .[develop] optional=[ - 'dmenu', "Jinja2>=2.10", "Whoosh>=2.7.4", ], |