Browse Source

Consistently use 'bootsteps', singleword no spaces or hyphens

Ask Solem 12 years ago
parent
commit
9bed6f539a

+ 2 - 2
celery/app/defaults.py

@@ -153,8 +153,8 @@ NAMESPACES = {
         'AGENT': Option(None, type='string'),
         'AGENT': Option(None, type='string'),
         'AUTOSCALER': Option('celery.worker.autoscale:Autoscaler'),
         'AUTOSCALER': Option('celery.worker.autoscale:Autoscaler'),
         'AUTORELOADER': Option('celery.worker.autoreload:Autoreloader'),
         'AUTORELOADER': Option('celery.worker.autoreload:Autoreloader'),
-        'BOOT_STEPS': Option((), type='tuple'),
-        'CONSUMER_BOOT_STEPS': Option((), type='tuple'),
+        'BOOTSTEPS': Option((), type='tuple'),
+        'CONSUMER_BOOTSTEPS': Option((), type='tuple'),
         'CONCURRENCY': Option(0, type='int'),
         'CONCURRENCY': Option(0, type='int'),
         'TIMER': Option(type='string'),
         'TIMER': Option(type='string'),
         'TIMER_PRECISION': Option(1.0, type='float'),
         'TIMER_PRECISION': Option(1.0, type='float'),

+ 7 - 6
celery/bootsteps.py

@@ -3,7 +3,7 @@
     celery.bootsteps
     celery.bootsteps
     ~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~
 
 
-    The boot-steps!
+    The bootsteps!
 
 
 """
 """
 from __future__ import absolute_import
 from __future__ import absolute_import
@@ -140,12 +140,12 @@ class Namespace(object):
         will also be added the the objects ``steps`` attribute.
         will also be added the the objects ``steps`` attribute.
 
 
         """
         """
-        self._debug('Loading boot-steps.')
+        self._debug('Preparing bootsteps.')
         order = self.order = []
         order = self.order = []
         steps = self.steps = self.claim_steps()
         steps = self.steps = self.claim_steps()
 
 
         self._debug('Building graph...')
         self._debug('Building graph...')
-        for name in self._finalize_boot_steps(steps):
+        for name in self._finalize_steps(steps):
             step = steps[name] = steps[name](parent, **kwargs)
             step = steps[name] = steps[name](parent, **kwargs)
             order.append(step)
             order.append(step)
         self._debug('New boot order: {%s}',
         self._debug('New boot order: {%s}',
@@ -178,7 +178,7 @@ class Namespace(object):
         for step in steps.values():
         for step in steps.values():
             [steps[n] for n in step.requires]
             [steps[n] for n in step.requires]
 
 
-    def _finalize_boot_steps(self, steps):
+    def _finalize_steps(self, steps):
         self._firstpass(steps)
         self._firstpass(steps)
         G = self.graph = DependencyGraph((C.name, C.requires)
         G = self.graph = DependencyGraph((C.name, C.requires)
                             for C in steps.itervalues())
                             for C in steps.itervalues())
@@ -190,13 +190,14 @@ class Namespace(object):
         try:
         try:
             return G.topsort()
             return G.topsort()
         except KeyError as exc:
         except KeyError as exc:
-            raise KeyError('unknown boot-step: %s' % exc)
+            raise KeyError('unknown bootstep: %s' % exc)
 
 
     def claim_steps(self):
     def claim_steps(self):
         return dict(self.load_step(step) for step in self._all_steps())
         return dict(self.load_step(step) for step in self._all_steps())
 
 
     def _all_steps(self):
     def _all_steps(self):
-        return self.types | self.app.steps[self.name]
+        print('My NAME IS: %r' % (self.name, ))
+        return self.types | self.app.steps[self.name.lower()]
 
 
     def load_step(self, step):
     def load_step(self, step):
         step = symbol_by_name(step)
         step = symbol_by_name(step)

+ 6 - 5
celery/worker/__init__.py

@@ -5,7 +5,7 @@
 
 
     :class:`WorkController` can be used to instantiate in-process workers.
     :class:`WorkController` can be used to instantiate in-process workers.
 
 
-    The worker consists of several components, all managed by boot-steps
+    The worker consists of several components, all managed by bootsteps
     (mod:`celery.bootsteps`).
     (mod:`celery.bootsteps`).
 
 
 """
 """
@@ -73,10 +73,11 @@ class WorkController(configurated):
     pidlock = None
     pidlock = None
 
 
     class Namespace(bootsteps.Namespace):
     class Namespace(bootsteps.Namespace):
-        """This is the boot-step namespace of the :class:`WorkController`.
+        """This is the bootstep namespace for the
+        :class:`WorkController` class.
 
 
-        It loads modules from :setting:`CELERYD_BOOT_STEPS`, and its
-        own set of built-in boot-step modules.
+        It loads modules from :setting:`CELERYD_BOOTSTEPS`, and its
+        own set of built-in bootsteps.
 
 
         """
         """
         name = 'Worker'
         name = 'Worker'
@@ -125,7 +126,7 @@ class WorkController(configurated):
 
 
         signals.worker_init.send(sender=self)
         signals.worker_init.send(sender=self)
 
 
-        # Initialize boot steps
+        # Initialize bootsteps
         self.pool_cls = _concurrency.get_implementation(self.pool_cls)
         self.pool_cls = _concurrency.get_implementation(self.pool_cls)
         self.steps = []
         self.steps = []
         self.on_init_namespace()
         self.on_init_namespace()

+ 4 - 4
celery/worker/components.py

@@ -3,7 +3,7 @@
     celery.worker.components
     celery.worker.components
     ~~~~~~~~~~~~~~~~~~~~~~~~
     ~~~~~~~~~~~~~~~~~~~~~~~~
 
 
-    Default worker boot-steps.
+    Default worker bootsteps.
 
 
 """
 """
 from __future__ import absolute_import
 from __future__ import absolute_import
@@ -38,7 +38,7 @@ class Hub(bootsteps.StartStopStep):
 
 
 
 
 class Queues(bootsteps.Step):
 class Queues(bootsteps.Step):
-    """This step initializes the internal queues
+    """This bootstep initializes the internal queues
     used by the worker."""
     used by the worker."""
     requires = (Hub, )
     requires = (Hub, )
 
 
@@ -66,7 +66,7 @@ class Queues(bootsteps.Step):
 
 
 
 
 class Pool(bootsteps.StartStopStep):
 class Pool(bootsteps.StartStopStep):
-    """The pool step.
+    """Bootstep managing the worker pool.
 
 
     Describes how to initialize the worker pool, and starts and stops
     Describes how to initialize the worker pool, and starts and stops
     the pool during worker startup/shutdown.
     the pool during worker startup/shutdown.
@@ -223,7 +223,7 @@ class Timers(bootsteps.Step):
 
 
 
 
 class StateDB(bootsteps.Step):
 class StateDB(bootsteps.Step):
-    """This step sets up the workers state db if enabled."""
+    """This bootstep sets up the workers state db if enabled."""
 
 
     def __init__(self, w, **kwargs):
     def __init__(self, w, **kwargs):
         self.enabled = w.state_db
         self.enabled = w.state_db

+ 6 - 6
docs/configuration.rst

@@ -1402,20 +1402,20 @@ The directory containing X.509 certificates used for
 Custom Component Classes (advanced)
 Custom Component Classes (advanced)
 -----------------------------------
 -----------------------------------
 
 
-.. setting:: CELERYD_BOOT_STEPS
+.. setting:: CELERYD_BOOTSTEPS
 
 
-CELERYD_BOOT_STEPS
-~~~~~~~~~~~~~~~~~~
+CELERYD_BOOTSTEPS
+~~~~~~~~~~~~~~~~~
 
 
 This setting enables you to add additional components to the worker process.
 This setting enables you to add additional components to the worker process.
 It should be a list of module names with
 It should be a list of module names with
 :class:`celery.bootsteps.Step`
 :class:`celery.bootsteps.Step`
 classes, that augments functionality in the worker.
 classes, that augments functionality in the worker.
 
 
-.. setting:: CELERYD_CONSUMER_BOOT_STEPS
+.. setting:: CELERYD_CONSUMER_BOOTSTEPS
 
 
-CELERYD_CONSUMER_BOOT_STEPS
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
+CELERYD_CONSUMER_BOOTSTEPS
+~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 
 This setting enables you to add additional components to the workers consumer.
 This setting enables you to add additional components to the workers consumer.
 It should be a list of module names with
 It should be a list of module names with

+ 1 - 1
docs/getting-started/introduction.rst

@@ -211,7 +211,7 @@ Features
         - **User Components**
         - **User Components**
 
 
             Each worker component can be customized, and additional components
             Each worker component can be customized, and additional components
-            can be defined by the user.  The worker is built up using "boot steps" — a
+            can be defined by the user.  The worker is built up using "bootsteps" — a
             dependency graph enabling fine grained control of the worker's
             dependency graph enabling fine grained control of the worker's
             internals.
             internals.