From b87a738ef25896e13e08c72fafb3e499a4a98759 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Sun, 5 Dec 2010 15:42:17 +0000 Subject: [PATCH] Add some comments to tag_categories.py to explain the structure of the stored user categories --- src/calibre/gui2/dialogs/tag_categories.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/calibre/gui2/dialogs/tag_categories.py b/src/calibre/gui2/dialogs/tag_categories.py index 210a2704bf..60092e4bd2 100644 --- a/src/calibre/gui2/dialogs/tag_categories.py +++ b/src/calibre/gui2/dialogs/tag_categories.py @@ -22,6 +22,15 @@ def __str__(self): return 'name=%s, label=%s, index=%s, exists='%(self.name, self.label, self.index, self.exists) class TagCategories(QDialog, Ui_TagCategories): + ''' + The structure of user_categories stored in preferences is + {cat_name: [ [name, category, v], [], []}, cat_name [ [name, cat, v] ...} + where name is the item name, category is where it came from (series, etc), + and v is a scratch area that this editor uses to keep track of categories. + + If you add a category, it is permissible to set v to zero. If you delete + a category, ensure that both the name and the category match. + ''' category_labels_orig = ['', 'authors', 'series', 'publisher', 'tags'] def __init__(self, window, db, on_category=None):