Meta-transforms shouldn't error on transform without name
authorJack Miller <jack@codezen.org>
Sun, 29 Nov 2015 02:22:15 +0000 (20:22 -0600)
committerJack Miller <jack@codezen.org>
Sun, 29 Nov 2015 02:22:15 +0000 (20:22 -0600)
canto_next/transform.py

index 15e0cfc..3ed8ff4 100644 (file)
@@ -140,7 +140,10 @@ class AllTransform(CantoTransform):
         for i, t in enumerate(args):
             if i > 0:
                 name += " AND "
-            name += t.name
+            if hasattr(t, "name"):
+                name += t.name
+            else:
+                name += "Unknown"
 
         name += ")"
         CantoTransform.__init__(self, name)
@@ -168,8 +171,10 @@ class AnyTransform(CantoTransform):
         for i, t in enumerate(args):
             if i > 0:
                 name += " OR "
-            name += t.name
-
+            if hasattr(t, "name"):
+                name += t.name
+            else:
+                name += "Unknown"
         name += ")"
         CantoTransform.__init__(self, name)
         self.transforms = args