diff piecrust/commands/builtin/baking.py @ 879:58ae026b4c31

chef: Optimize startup time.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 15 Jun 2017 22:38:05 -0700
parents 93ea115027fc
children 803c5c28a71f
line wrap: on
line diff
--- a/piecrust/commands/builtin/baking.py	Thu Jun 15 22:16:34 2017 -0700
+++ b/piecrust/commands/builtin/baking.py	Thu Jun 15 22:38:05 2017 -0700
@@ -1,9 +1,6 @@
 import os.path
 import time
-import pprint
 import logging
-import fnmatch
-import textwrap
 import datetime
 from colorama import Fore
 from piecrust.commands.base import ChefCommand
@@ -166,6 +163,7 @@
             help="Show manifest entries from the record.")
 
     def run(self, ctx):
+        import fnmatch
         from piecrust.baking.baker import get_bake_records_path
         from piecrust.pipelines.records import load_records
 
@@ -281,6 +279,9 @@
 
 
 def _print_record_entry(e):
+    import pprint
+    import textwrap
+
     logger.info(" - %s" % e.item_spec)
     logger.info("   Outputs:")
     out_paths = list(e.getAllOutputPaths())