Sort cookbook after adding a new recipe.
authorW. Trevor King <wking@drexel.edu>
Wed, 18 Aug 2010 00:41:10 +0000 (20:41 -0400)
committerW. Trevor King <wking@drexel.edu>
Wed, 18 Aug 2010 00:41:10 +0000 (20:41 -0400)
cookbook/server.py

index e62dd849106162c82e2645f9a964afc3abd46d11..e94e7693e95977d03441d8e6b424ceafd82eb799 100644 (file)
@@ -165,6 +165,7 @@ class Server (object):
             print 'new'
             self.cookbook.append(recipe)
             self.cookbook.make_index()
+            self.cookbook.sort(key=lambda r: r.path)
         elif name != recipe.name:  # renamed recipe
             print 'rename'
             os.remove(recipe.path)