mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Sorted user recipes in serialize_collection
This commit is contained in:
parent
4ecd8d2c6d
commit
62759f161b
@ -61,8 +61,8 @@ def serialize_recipe(urn, recipe_class):
|
|||||||
|
|
||||||
def serialize_collection(mapping_of_recipe_classes):
|
def serialize_collection(mapping_of_recipe_classes):
|
||||||
collection = E.recipe_collection()
|
collection = E.recipe_collection()
|
||||||
for urn, recipe_class in mapping_of_recipe_classes.items():
|
for urn in sorted(mapping_of_recipe_classes.keys(), key = lambda key: mapping_of_recipe_classes[key].title):
|
||||||
recipe = serialize_recipe(urn, recipe_class)
|
recipe = serialize_recipe(urn, mapping_of_recipe_classes[urn])
|
||||||
collection.append(recipe)
|
collection.append(recipe)
|
||||||
collection.set('count', str(len(collection)))
|
collection.set('count', str(len(collection)))
|
||||||
return etree.tostring(collection, encoding='utf-8', xml_declaration=True,
|
return etree.tostring(collection, encoding='utf-8', xml_declaration=True,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user