Commits

Boris FELD  committed 3005981

Rename Output to Item and update other files.

  • Participants
  • Parent commits d103687
  • Branches feature/FixTerminology

Comments (0)

Files changed (4)

File pytasks/Item.py

+class Item(object):
+
+    def __init__(self):
+        self.tags = set()
+
+    def has_tags(self, tags):
+        return self.tags.issuperset(tags)
+
+    def __str__(self):
+        return "Output(tags = %s)" % (self.tags)
+
+    def __repr__(self):
+        return self.__str__()

File pytasks/Output.py

-class Output(object):
-
-    def __init__(self, value):
-        self._value = value
-        self._tags = set()
-
-    def add_tag(self, tag):
-        self._tags.add(tag)
-
-    def has_tag(self, tag):
-        return tag in self._tags
-
-    def has_tags(self, tags):
-        return self._tags.issuperset(tags)
-
-    def get_tags(self):
-        return self._tags
-
-    def get_value(self):
-        return self._value
-
-    def __str__(self):
-        return "Output(value = %s, tags = %s)" % (self._value, self._tags)
-
-    def __repr__(self):
-        return self.__str__()

File pytasks/Recipe.py

                      FailStatus, TooMuchItemStatus, StdCatch)
 from .Exceptions import (DependenceNameAlreadyDeclared, ArgumentException,
                          CircularReference, DependenceMissing, SkipException)
-from .Output import Output
+from .Item import Item
 
 class Recipe(object):
     def __init__(self):
         if base_inputs is not None:
             for input_type, inputs in base_inputs.iteritems():
                 for input_value in inputs:
-                    if isinstance(input_value, Output):
+                    if isinstance(input_value, Item):
                         self._messenger.store(input_type, input_value)
                     else:
-                        self._messenger.store(input_type, Output(input_value))
+                        self._messenger.store(input_type, Item(input_value))
 
         task = self._choose_task()
 
                 for output_type, outputs in returns.iteritems():
                     for output in outputs:
 
-                        output_object = Output(output)
+                        output_object = Item(output)
 
                         #Add tags
                         for tag in self._output_tags.get(task.name, []):

File tests/TestRecipe.py

                                 DependenceNameAlreadyDeclared, SkipException)
 from pytasks.Status import (NormalStatus, SkipStatus, DependencySkipStatus,
                             FailStatus, TooMuchItemStatus)
-from pytasks.Output import Output
+from pytasks.Item import Item
 from pytasks.Messenger import Messenger
 
 class RecipeStoreTestCase(unittest.TestCase):