def read_file(self,f): blockoflines = Mio.generReadUntil(f,'}') for line in blockoflines: key = Mio.findKey(line,'','=').strip() value = Mio.findKey(line,'{','}').strip() if key == 'author': authors = AuthorList() authors.new_authors_from_line(value) self.authors = authors else: if key == 'title': value = Title(value) setattr(self,key,value)
def yield_file_items(f, filetag, commentmarker='#'): for line in Mio.yield_no_comments(f, comment=commentmarker): words = line.strip().split(':') key, value = words[0].strip(), words[1].strip() isfile = key.startswith(filetag) if isfile: # strip filetag key = Mio.findKey(key, filetag, '') yield (key, value, isfile)
def yield_file_items(f,filetag,commentmarker='#'): for line in Mio.yield_no_comments(f,comment=commentmarker): words = line.strip().split(':') key, value = words[0].strip(), words[1].strip() isfile = key.startswith(filetag) if isfile: # strip filetag key = Mio.findKey(key,filetag,'') yield (key, value, isfile)
def getLineInfo(line): key = Mio.findKey(line, '', '=').rstrip() value = Mio.findKey(line, '{', '}') return key, value
def getReferenceKey(line): articletype = Mio.findKey(line, '@', '{') key = Mio.findKey(line, '{', ',') return articletype, key
def get_type_key(self,line): articletype = Mio.findKey(line,'@','{') key = Mio.findKey(line,'{',',') return articletype, key
def getLineInfo(line): key = Mio.findKey(line,'','=').rstrip() value = Mio.findKey(line,'{','}') return key, value
def getReferenceKey(line): articletype = Mio.findKey(line,'@','{') key = Mio.findKey(line,'{',',') return articletype, key