Browse Source

Add the ability to mark a value as derived at runtime.

Some jobs, like parsing the obs4_bridgeline file, don't belong in
Chutney.  Fortunately, our template-and-environment system makes
those easy to override.
Nick Mathewson 5 years ago
parent
commit
fa0bc73bee
1 changed files with 7 additions and 0 deletions
  1. 7 0
      lib/chutney/TorNet.py

+ 7 - 0
lib/chutney/TorNet.py

@@ -278,6 +278,13 @@ class Node(object):
     def specialize(self, **kwargs):
         return Node(parent=self, **kwargs)
 
+    def set_runtime(self, key, fn):
+        """Specify a runtime function that gets invoked to find the
+           runtime value of a key.  It should take a single argument, which
+           will be an environment.
+        """
+        setattr(self._env, "_get_"+key, fn)
+
     ######
     # Chutney uses these: