fabdeploy / fabdeploy / containers.py

Diff from to

fabdeploy/containers.py

 class BaseConf(MutableMapping):
     _attrs = (
         '_name',
-        '_task',
+        '_tasks',
         '_global_conf',
         '_versions',
         '_conf_value',
     def __init__(
         self,
         name=None,
-        task=None,
+        tasks=None,
         global_conf=None,
         versions=['active', 'last', 'previous']):
         self._name = name or 'unknown'
-        self._task = task
+        self._tasks = tasks or []
         self._global_conf = global_conf or self
         self._versions = versions
 
     def set_name(self, name):
         self._name = name
 
-    def set_task(self, task):
-        self._task = task
+    def add_task(self, task):
+        self._tasks.append(task)
 
     def set_global_conf(self, conf):
         self._global_conf = conf
         return value
 
     def _conf_raw_value(self, name):
-        if self._task:
+        for task in self._tasks:
             try:
-                return self._task.conf_value(name)
+                return task.conf_value(name)
             except MissingVarException:
-                pass
+                continue
         try:
             return super(BaseConf, self).__getattribute__(name)
         except AttributeError:
         builtins = set([k for k in dir(BaseConf)])
         keys = [k for k in dir(self)
                 if not k.startswith('_') and k not in builtins]
-        if self._task:
-            keys.extend(self._task.conf_keys())
+        for task in self._tasks:
+            keys.extend(task.conf_keys())
         return keys
 
     def setdefault(self, key, default=None):
     def copy(self):
         d = self.__class__(
             global_conf=self._global_conf,
-            task=self._task,
+            tasks=self._tasks,
             name=self._name)
         d._copy_conf(self)
         return d
     # directory name that contains manage.py file (django project root)
     django_dir = ''
     home_path = conf(lambda self: home_path(self.user))
+    fabdeploy_path = ['%(home_path)s', '.fabdeploy.d']
+    fabdeploy_bin_path = ['%(home_path)s', '.fabdeploy.d', 'bin']
     version_path = ['%(home_path)s', '%(version)s']
     version_data_file = ['%(version_path)s', '.fabdeploy']
     src_path = ['%(version_path)s', 'src']
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.