diff options
author | hut <hut@lepus.uberspace.de> | 2014-12-03 23:40:53 +0100 |
---|---|---|
committer | hut <hut@lepus.uberspace.de> | 2014-12-03 23:44:02 +0100 |
commit | 30513c6585b685afc157efcb979c722731885e50 (patch) | |
tree | 48b72ee8c8eb1bbdd2960f8f87f53f8f5197a159 | |
parent | 0f15efb7a8893ed8161a42ef0a21094b98ee4dc5 (diff) | |
download | ranger-30513c6585b685afc157efcb979c722731885e50.tar.gz |
ext.papermanager: moved and commented a function
-rw-r--r-- | ranger/ext/papermanager.py | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/ranger/ext/papermanager.py b/ranger/ext/papermanager.py index 15fc13a5..c01ea784 100644 --- a/ranger/ext/papermanager.py +++ b/ranger/ext/papermanager.py @@ -116,17 +116,6 @@ class PaperManager(object): self._fill_row_with_ostruct(row, update_dict) writer.writerow(row) - def _fill_row_with_ostruct(self, row, update_dict): - for key, value in update_dict.items(): - if key == "year": - row[1] = value - elif key == "title": - row[2] = value - elif key == "authors": - row[3] = value - elif key == "url": - row[4] = value - def _get_metafile_content(self, metafile): if metafile in self.metafile_cache: return self.metafile_cache[metafile] @@ -161,3 +150,15 @@ class PaperManager(object): if title: ostruct['title'] = title if authors: ostruct['authors'] = authors if url: ostruct['url'] = url + + def _fill_row_with_ostruct(self, row, update_dict): + # Copy data from a dict/ostruct into a CSV row + for key, value in update_dict.items(): + if key == "year": + row[1] = value + elif key == "title": + row[2] = value + elif key == "authors": + row[3] = value + elif key == "url": + row[4] = value |