summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2014-12-03 23:39:03 +0100
committerhut <hut@lepus.uberspace.de>2014-12-03 23:39:03 +0100
commit0f15efb7a8893ed8161a42ef0a21094b98ee4dc5 (patch)
tree1245800910dfc21f5d8888ff41a361d0a19a45cd
parentd0c71b43671de40930438acde622cec1943c214b (diff)
downloadranger-0f15efb7a8893ed8161a42ef0a21094b98ee4dc5.tar.gz
ext.papermanager: added comments
-rw-r--r--ranger/ext/papermanager.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/ranger/ext/papermanager.py b/ranger/ext/papermanager.py
index 932505c9..15fc13a5 100644
--- a/ranger/ext/papermanager.py
+++ b/ranger/ext/papermanager.py
@@ -141,6 +141,11 @@ class PaperManager(object):
                 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:
@@ -149,8 +154,10 @@ class PaperManager(object):
                 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