def load(self): """ Returns filtered, complete items """ if not check_path(self.zotero_database): return [] self.filter_items() self.get_item_detail() return self.index.items()
def __init__(self, context): self.context = context self.zotero_path = context['zotero_path'] self.cache_path = context['cache_path'] self.et_al_limit = context['et_al_limit'] self.key_format = context['key_format'] self.html_regex = re.compile('<[^<]+?>') if not check_path(os.path.join(self.zotero_path, u"zotero.sqlite")): raiseError(u"{} is not a valid zotero path".format(self.zotero_path))
def __init__(self, context): self.context = context self.zotero_path = context['zotero_path'] self.cache_path = context['cache_path'] self.et_al_limit = context['et_al_limit'] self.key_format = context['key_format'] self.clean_regex = re.compile( "[^A-Za-z0-9\ \!\$\&\*\+\-\.\/\:\;\<\>\?\[\]\^\_\`\|]+") self.html_regex = re.compile('<[^<]+?>') if not check_path(os.path.join(self.zotero_path, u"zotero.sqlite")): raiseError(u"{} is not a valid zotero path".format( self.zotero_path))
def load(self): """ Returns: A zotero database as an array of Items. """ if not check_path(os.path.join(self.zotero_path, u"zotero.sqlite")): raiseError(u"Citation.vim Error:", self.zotero_path, u"is not a valid zotero path") return [] zotero = zoteroData(self.context) zot_data = zotero.load() bb = betterBibtex(self.zotero_path, self.cache_path) citekeys = bb.load_citekeys() items = [] for zot_id, zot_item in zot_data: item = Item() item.abstract = zot_item.abstract item.author = self.format_author(zot_item) item.collections = zot_item.collections item.date = zot_item.date item.doi = zot_item.doi item.file = self.format_fulltext(zot_item) item.isbn = zot_item.isbn item.publication = zot_item.publication item.key = self.format_key(zot_item, citekeys) item.language = zot_item.language item.issue = zot_item.issue item.notes = self.format_notes(zot_item) item.pages = zot_item.pages item.publisher = zot_item.publisher item.tags = self.format_tags(zot_item) item.title = zot_item.title item.type = zot_item.type item.url = zot_item.url item.volume = zot_item.volume item.combine() items.append(item) return items
def __init__(self, context): self.context = context if not check_path(self.context['bibtex_file']): raiseError(u"{} does not exist".format( self.context['bibtex_file'])) return []
def __init__(self, context): self.context = context self.bibtex_file = check_path(self.context.bibtex_file) self.et_al_limit = context.et_al_limit