Skip to content

Commit

Permalink
ext.papermanager: added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hut committed Dec 3, 2014
1 parent d0c71b4 commit 0f15efb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions ranger/ext/papermanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ def _get_metafile_content(self, metafile):
return []

def _get_metafile_names(self, path):
# Iterates through the paths of all .paperinfo files that could
# influence the metadata of the given file.
# When deep_search is deactivated, this only yields the .paperinfo file
# in the same directory as the given file.

base = dirname(path)
yield join(base, PAPERINFO_FILE_NAME)
if self.deep_search:
Expand All @@ -149,8 +154,10 @@ def _get_metafile_names(self, path):
yield join("/" + "/".join(dirs[0:i]), PAPERINFO_FILE_NAME)

def _fill_ostruct_with_data(self, ostruct, dataset):
# Copy data from a CSV row to a dict/ostruct

filename, year, title, authors, url = dataset
if year: ostruct.year = year
if title: ostruct.title = title
if authors: ostruct.authors = authors
if url: ostruct.url = url
if year: ostruct['year'] = year
if title: ostruct['title'] = title
if authors: ostruct['authors'] = authors
if url: ostruct['url'] = url

0 comments on commit 0f15efb

Please sign in to comment.