comparison piecrust/processing/worker.py @ 663:3ceeca7bb71c

themes: Add support for a `--theme` argument to `chef`.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 01 Mar 2016 22:27:28 -0800
parents aefe70229fdd
children 81d9c3a3a0b5
comparison
equal deleted inserted replaced
662:cbd5cdec0695 663:3ceeca7bb71c
21 split_processor_names_re = re.compile(r'[ ,]+') 21 split_processor_names_re = re.compile(r'[ ,]+')
22 re_ansicolors = re.compile('\033\\[\d+m') 22 re_ansicolors = re.compile('\033\\[\d+m')
23 23
24 24
25 class ProcessingWorkerContext(object): 25 class ProcessingWorkerContext(object):
26 def __init__(self, root_dir, out_dir, tmp_dir, 26 def __init__(self, root_dir, out_dir, tmp_dir, *,
27 force=False, debug=False): 27 force=False, debug=False, theme_site=False):
28 self.root_dir = root_dir 28 self.root_dir = root_dir
29 self.out_dir = out_dir 29 self.out_dir = out_dir
30 self.tmp_dir = tmp_dir 30 self.tmp_dir = tmp_dir
31 self.force = force 31 self.force = force
32 self.debug = debug 32 self.debug = debug
33 self.theme_site = theme_site
33 self.is_profiling = False 34 self.is_profiling = False
34 self.enabled_processors = None 35 self.enabled_processors = None
35 self.additional_processors = None 36 self.additional_processors = None
36 37
37 38
57 self.ctx = ctx 58 self.ctx = ctx
58 self.work_start_time = time.perf_counter() 59 self.work_start_time = time.perf_counter()
59 60
60 def initialize(self): 61 def initialize(self):
61 # Create the app local to this worker. 62 # Create the app local to this worker.
62 app = PieCrust(self.ctx.root_dir, debug=self.ctx.debug) 63 app = PieCrust(self.ctx.root_dir, debug=self.ctx.debug,
64 theme_site=self.ctx.theme_site)
63 app.env.registerTimer("PipelineWorker_%d_Total" % self.wid) 65 app.env.registerTimer("PipelineWorker_%d_Total" % self.wid)
64 app.env.registerTimer("PipelineWorkerInit") 66 app.env.registerTimer("PipelineWorkerInit")
65 app.env.registerTimer("JobReceive") 67 app.env.registerTimer("JobReceive")
66 app.env.registerTimer('BuildProcessingTree') 68 app.env.registerTimer('BuildProcessingTree')
67 app.env.registerTimer('RunProcessingTree') 69 app.env.registerTimer('RunProcessingTree')