From e83e46be9b2ee7282dd1333b1681e1c67a870d7e Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Wed, 5 Aug 2020 14:12:43 +0100 Subject: [PATCH] Adds pycache to gitignore --- .gitignore | 1 + .../__pycache__/contacts.cpython-38.pyc | Bin 2325 -> 0 bytes rplugin/python3/deoplete/sources/contacts.py | 68 ------------------ 3 files changed, 1 insertion(+), 68 deletions(-) delete mode 100644 rplugin/python3/deoplete/sources/__pycache__/contacts.cpython-38.pyc delete mode 100644 rplugin/python3/deoplete/sources/contacts.py diff --git a/.gitignore b/.gitignore index a0e76af..5033691 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .netrwhist +__pychache__ diff --git a/rplugin/python3/deoplete/sources/__pycache__/contacts.cpython-38.pyc b/rplugin/python3/deoplete/sources/__pycache__/contacts.cpython-38.pyc deleted file mode 100644 index 917429d29e92343514a0ae79b3fb3d0b2ef92637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2325 zcmZuzUvtw&5Wmwu%Z}rO03A9_OPX{_Tp)(_p`8pv`P+6n#V{d#5d~GzooywuB<^G& zM(IOghNpf9`>B%;(JykZec~(dLU+${a0&8g?{@E2xBJ^a=U?aNYXqKu{yu!vsS@%p zGP92b%r$uBcR(0nG$!6;q@JO9(=(aD%-HJNo=wS*gjvjfNtn&;7pCVhdY?3%*Pu<> zuPM+bRo0C_@(@L{k6AKu2PT|&lo8M1=E!1nOg&rA44653X2PuUigc(x&h=d8u*yr~ zRhi4GFxFU&&A~Xw>TDjyI%}{680TLRi+Bw%YEe1&(}4*2(AxY>em`_J&R@Xs+@tjy zVOZP@iyuVVFSd9V?_bk$cPqTIwf6F5Z_?5 zOJM}GfLhFCRu^YBvw=Fy0a{@M46C#~s~<%1u<{_-Nz=WDUZWr6VUG(x=1Dj2c}r8i zGl*lqGZ+r{1!C*jTA}GGTMjZVlv4&mq0Qjyort%7m&ZxqykvoxK zuyhFQwz8fCLJrSPEnX`vUegG#u^21oB(b@mb5%gbTWJnjMP;R(AM5MMuQF;CA{U9W9VXfYjo={ zDFE3qDUqUWDCm<%#`c3fKFKh#3|rr~!G#0(6Q1Pf&=eJWFCKX|50p0K8+(?)!Xo9r-+)5L?J4^82{1Ue1b>cfhzU_VP` zlt*cD8T86@TBM5r$Ni=TxX$jf-J+3I65TW+)PXH zDy1&me`uT31_`W)_u}N$eg9n+oBIagjEVGlnP2K+S427x3D^eh=41 z4OUV%h;a_zeLM)_a>WoFTTMU1mh>f>fi*2wkzho{XGm6%e1YUV5-c+{UtSv_hs(>K zv3>!!V6PHbCzyQ_IT!mBtr_(>*Ktj^;yQZ0SrM0D)vKg%dq9zj)4&PzS6Mso2Sb?1 dA9 diff --git a/rplugin/python3/deoplete/sources/contacts.py b/rplugin/python3/deoplete/sources/contacts.py deleted file mode 100644 index 0d76e6e..0000000 --- a/rplugin/python3/deoplete/sources/contacts.py +++ /dev/null @@ -1,68 +0,0 @@ -# Modified by Jonathan Hodgson - -# Originally from https://github.com/michaeladler/deoplete-abook/blob/master/rplugin/python3/deoplete/sources/abook.py -# Original Copyright: -# Copyright (c) 2017 Filip SzymaƄski. All rights reserved. -# Use of this source code is governed by an MIT license that can be -# found in the LICENSE file. - -import configparser -import os.path -import re - -from .base import Base # pylint: disable=E0401 - - -# pylint: disable=W0201,W0613 -class Source(Base): - COLON_PATTERN = re.compile(r':\s?') - COMMA_PATTERN = re.compile(r'.+,\s?') - HEADER_PATTERN = re.compile(r'^(Bcc|Cc|From|Reply-To|To):(\s?|.+,\s?)') - - def __init__(self, vim): - super().__init__(vim) - - self.__cache = [] - - self.filetypes = ['mail'] - self.mark = '[abook]' - self.matchers = ['matcher_length', 'matcher_full_fuzzy'] - self.min_pattern_length = 0 - self.name = 'abook' - - def on_init(self, context): - self.__datafile = context['vars'].get('deoplete#sources#abook#datafile', - os.path.expanduser('~/.abook/addressbook')) - if not os.path.isfile(self.__datafile): - self.vim.err_write('[deoplete-abook] No such file: {0}\n'.format(self.__datafile)) - - def on_event(self, context): - self.__make_cache() - - def gather_candidates(self, context): - if self.HEADER_PATTERN.search(context['input']) is not None: - if not self.__cache: - self.__make_cache() - - return self.__cache - - def get_complete_position(self, context): - colon = self.COLON_PATTERN.search(context['input']) - comma = self.COMMA_PATTERN.search(context['input']) - return max(colon.end() if colon is not None else -1, - comma.end() if comma is not None else -1) - - def __make_cache(self): - addressbook = configparser.ConfigParser() - addressbook.read(self.__datafile) - for section in addressbook.sections(): - emails = addressbook.get(section, 'email', fallback=None) - if emails is not None: - name = addressbook.get(section, 'name', fallback=None) - for email in emails.split(','): - if name is not None: - email = '"{0}" <{1}>'.format(name, email) - - self.__cache.append({'word': email}) - -# vim: ts=4 et sw=4