OK, I am confused. As far as I can see, the categories are deleted.
Tested using the following program:
Code:
from calibre.library.database2 import LibraryDatabase2
db = LibraryDatabase2(r'C:\CBH_Data\calibre_development\Library.test_small')
for k in sorted(db.prefs.get('user_categories', {})):
print k
I start the calibre gui, then run the program while the GUI is still running. The output is:
Code:
>calibre-debug -e print_user_categories.py
2
AA
AA.1
AA.1.2
bb
bb.asdasaaa
bb.b2
bb.b2.asdasaaa
bb.b2.d
bb.zzz
g
Using the still-running calibre's gui, I delete the category '2' using right-click & delete, then run the program again.
Code:
>calibre-debug -e print_user_categories.py
AA
AA.1
AA.1.2
bb
bb.asdasaaa
bb.b2
bb.b2.asdasaaa
bb.b2.d
bb.zzz
g
The category '2' is gone. Still running the same calibre GUI instance, I delete AA using right-click and delete. The result:
Code:
>calibre-debug -e print_user_categories.py
bb
bb.asdasaaa
bb.b2
bb.b2.asdasaaa
bb.b2.d
bb.zzz
g
AA and all its children are gone.
I shut down calibre and again run the program. The output is the same as the last one above. I restart calibre and again run the program. The output is again the same. I use manage categories, and the categories are not there. I re-add the category '2'. It appears, but without content.
What are you doing that is different from the above?