Esempio n. 1
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if not isinstance(context.application.cache.node, ConscanResults): return False
     # C) passed all tests:
     return True
Esempio n. 2
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if len(context.application.cache.children) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 3
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if len(context.application.cache.nodes) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 4
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if context.application.main is None: return False
     # C) passed all tests:
     return True
Esempio n. 5
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     if len(context.application.cache.nodes) == 0: return False
     if context.application.cache.some_nodes_without_children_fixed: return False
     # C) passed all tests:
     return True
Esempio n. 6
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if context.application.main is None: return False
     # C) passed all tests:
     return True
Esempio n. 7
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) own tests
     if len(context.application.cache.nodes) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 8
0
    def analyze_selection():
        # A) calling ancestor
        if not Immediate.analyze_selection(): return False
        # B) validating

        # C) passed all tests:
        return True
Esempio n. 9
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     cache = context.application.cache
     if len(cache.nodes) < 2: return False
     Frame = context.application.plugins.get_node("Frame")
     for cls in cache.classes:
         if not issubclass(cls, Frame): return False
     return True
Esempio n. 10
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     cache = context.application.cache
     if len(cache.nodes) < 2: return False
     Frame = context.application.plugins.get_node("Frame")
     for cls in cache.classes:
         if not issubclass(cls, Frame): return False
     return True
Esempio n. 11
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     redo_stack = context.application.action_manager.redo_stack
     if len(redo_stack) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 12
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     for Class in context.application.cache.classes:
         if not issubclass(Class, SavedSelection): return False
     # C) passed all tests:
     return True
Esempio n. 13
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     undo_stack = context.application.action_manager.undo_stack
     if len(undo_stack) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 14
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     for Class in context.application.cache.classes:
         if not issubclass(Class, SavedSelection): return False
     # C) passed all tests:
     return True
Esempio n. 15
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     universe = context.application.model.universe
     if sum(universe.cell.active) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 16
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if not isinstance(context.application.cache.node, ConscanResults):
         return False
     # C) passed all tests:
     return True
Esempio n. 17
0
 def analyze_selection(parameters=None):
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     universe = context.application.model.universe
     if sum(universe.cell.active) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 18
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     if len(context.application.cache.nodes) == 0: return False
     if context.application.cache.some_nodes_without_children_fixed:
         return False
     # C) passed all tests:
     return True
Esempio n. 19
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if cache.some_nodes_fixed: return False
     if not isinstance(cache.parent, ContainerMixin): return False
     # D) passed all tests:
     return True
Esempio n. 20
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     last_action = context.application.action_manager.last_action
     if last_action is None: return False
     if not last_action.want_repeat(): return False
     # C) passed all tests:
     return True
Esempio n. 21
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     last_action = context.application.action_manager.last_action
     if last_action is None: return False
     if not last_action.want_repeat(): return False
     # C) passed all tests:
     return True
Esempio n. 22
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if cache.some_nodes_fixed: return False
     if not isinstance(cache.parent, ContainerMixin): return False
     # D) passed all tests:
     return True
Esempio n. 23
0
 def analyze_selection():
     # A) calling ancestors
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if cache.some_nodes_fixed: return False
     if len(cache.transformed_nodes) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 24
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     parents = context.application.cache.parents
     if len(parents) == 0: return False
     if len(parents) == 1 and parents[0] is None: return False
     # C) passed all tests:
     return True
Esempio n. 25
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     parents = context.application.cache.parents
     if len(parents) == 0: return False
     if len(parents) == 1 and parents[0] is None: return False
     # C) passed all tests:
     return True
Esempio n. 26
0
 def analyze_selection():
     # A) calling ancestors
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if cache.some_nodes_fixed: return False
     if len(cache.transformed_nodes) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 27
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     if not isinstance(context.application.cache.node, GLContainerMixin):
         return False
     if len(context.application.cache.node.children) == 0: return False
     # C) passed all tests:
     return True
Esempio n. 28
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if not isinstance(cache.node, ContainerMixin): return False
     clipboard = gtk.clipboard_get()
     if not clipboard.wait_is_target_available("ZML"): return False
     # C) passed all tests:
     return True
Esempio n. 29
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     for cls in cache.classes:
         if not issubclass(cls, Spring):
             return False
     # C) passed all tests:
     return True
Esempio n. 30
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     for cls in cache.classes:
         if not issubclass(cls, Spring):
             return False
     # C) passed all tests:
     return True
Esempio n. 31
0
 def analyze_selection():
     # A) calling ancestors
     if not Immediate.analyze_selection(): return False
     # B) validating
     node = context.application.cache.node
     Universe = context.application.plugins.get_node("Universe")
     if not isinstance(node, Universe): return False
     if node.cell.active.sum() == 0: return False
     # C) passed all tests:
     return True
Esempio n. 32
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) != 2: return False
     if len(cache.translations) != 2: return False
     if cache.common_parent is None: return False
     # C) passed all tests:
     return True
Esempio n. 33
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) == 0: return False
     for cls in cache.classes:
         if issubclass(cls, Reference): return False
     # C) passed all tests:
     return True
Esempio n. 34
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) < 3: return False
     if len(cache.translations) < 3: return False
     if cache.common_parent is None: return False
     # C) passed all tests:
     return True
Esempio n. 35
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if not isinstance(cache.node, ContainerMixin): return False
     clipboard = gtk.clipboard_get()
     if not clipboard.wait_is_target_available("ZML"): return False
     # C) passed all tests:
     return True
Esempio n. 36
0
 def analyze_selection():
     # A) calling ancestors
     if not Immediate.analyze_selection(): return False
     # B) validating
     node = context.application.cache.node
     Universe = context.application.plugins.get_node("Universe")
     if not isinstance(node, Universe): return False
     if node.cell_active.sum() == 0: return False
     # C) passed all tests:
     return True
Esempio n. 37
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) == 0: return False
     for cls in cache.classes:
         if issubclass(cls, Reference): return False
     # C) passed all tests:
     return True
Esempio n. 38
0
 def analyze_selection(AddModelObject):
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     # first check wether the nodes parameter is ok:
     # only one node and it should accept the an AddModelObject
     node = context.application.cache.node
     if not isinstance(node, ContainerMixin): return False
     if not node.check_add(AddModelObject): return False
     # C) passed all tests:
     return True
Esempio n. 39
0
 def analyze_selection(AddModelObject):
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     # first check wether the nodes parameter is ok:
     # only one node and it should accept the an AddModelObject
     node = context.application.cache.node
     if not isinstance(node, ContainerMixin): return False
     if not node.check_add(AddModelObject): return False
     # C) passed all tests:
     return True
Esempio n. 40
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) < 1: return False
     if len(cache.nodes) + sum(context.application.model.universe.cell.active) > 3: return False
     for Class in cache.classes:
         if not issubclass(Class, Vector): return False
     # C) passed all tests:
     return True
Esempio n. 41
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     transformed_nodes = cache.transformed_nodes
     translated_nodes = cache.translated_nodes
     if len(transformed_nodes) == 0: return False
     if (len(translated_nodes) == 1) and (len(cache.rotated_nodes) == 0): return False
     if some_fixed(transformed_nodes): return False
     # C) passed all tests:
     return True
Esempio n. 42
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating & initializing
     node = context.application.cache.node
     Frame = context.application.plugins.get_node("Frame")
     if not Frame.check_add(node.__class__): return False
     if node.get_fixed(): return False
     if not isinstance(node, GLTransformationMixin): return False
     if not node.parent.check_add(Frame): return False
     # C) passed all tests:
     return True
Esempio n. 43
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating & initializing
     node = context.application.cache.node
     Frame = context.application.plugins.get_node("Frame")
     if not Frame.check_add(node.__class__): return False
     if node.get_fixed(): return False
     if not isinstance(node, GLTransformationMixin): return False
     if not node.parent.check_add(Frame): return False
     # C) passed all tests:
     return True
Esempio n. 44
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     transformed_nodes = cache.transformed_nodes
     translated_nodes = cache.translated_nodes
     if len(transformed_nodes) == 0: return False
     if (len(translated_nodes) == 1) and (len(cache.rotated_nodes) == 0):
         return False
     if some_fixed(transformed_nodes): return False
     # C) passed all tests:
     return True
Esempio n. 45
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if len(cache.nodes) < 1: return False
     if len(cache.nodes) + sum(
             context.application.model.universe.cell.active) > 3:
         return False
     for Class in cache.classes:
         if not issubclass(Class, Vector): return False
     # C) passed all tests:
     return True
Esempio n. 46
0
 def analyze_selection(NewParentClass):
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     old_parent = cache.parent
     if old_parent is None: return False
     if not isinstance(old_parent, ContainerMixin): return False
     if not old_parent.check_add(NewParentClass): return False
     if cache.some_nodes_fixed: return False
     for Class in cache.classes:
         if not NewParentClass.check_add(Class): return False
     # C) Passed all tests
     return True
Esempio n. 47
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if cache.node is None: return False
     contains_atoms = False
     for cls in cache.child_classes:
         if issubclass(cls, Atom):
             contains_atoms = True
             break
     if not contains_atoms: return False
     # C) passed all tests
     return True
Esempio n. 48
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     old_parent = cache.parent
     if old_parent is None: return False
     new_parent = old_parent.parent
     if new_parent is None: return False
     if cache.some_nodes_fixed: return False
     for Class in cache.classes:
         if not new_parent.check_add(Class): return False
     # C) passed all tests
     return True
Esempio n. 49
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     new_parent = cache.parent
     if new_parent is None: return False
     for Class in cache.classes:
         if not issubclass(Class, ContainerMixin): return False
     if cache.some_children_fixed: return False
     for Class in cache.child_classes:
         if not new_parent.check_add(Class): return False
     # C) passed all tests
     return True
Esempio n. 50
0
 def analyze_selection(NewParentClass):
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     old_parent = cache.parent
     if old_parent is None: return False
     if not isinstance(old_parent, ContainerMixin): return False
     if not old_parent.check_add(NewParentClass): return False
     if cache.some_nodes_fixed: return False
     for Class in cache.classes:
         if not NewParentClass.check_add(Class): return False
     # C) Passed all tests
     return True
Esempio n. 51
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     old_parent = cache.parent
     if old_parent is None: return False
     new_parent = old_parent.parent
     if new_parent is None: return False
     if cache.some_nodes_fixed: return False
     for Class in cache.classes:
         if not new_parent.check_add(Class): return False
     # C) passed all tests
     return True
Esempio n. 52
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating and initialising
     cache = context.application.cache
     if len(cache.nodes) == 0: return False
     if len(cache.translations) == 0: return False
     parent = cache.common_parent
     if parent == None: return False
     while not parent.check_add(Point):
         parent = parent.parent
         if parent == None: return False
     # C) passed all tests:
     return True
Esempio n. 53
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     new_parent = cache.parent
     if new_parent is None: return False
     for Class in cache.classes:
         if not issubclass(Class, ContainerMixin): return False
     if cache.some_children_fixed: return False
     for Class in cache.child_classes:
         if not new_parent.check_add(Class): return False
     # C) passed all tests
     return True
Esempio n. 54
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating and initialising
     cache = context.application.cache
     if len(cache.nodes) == 0: return False
     if len(cache.translations) == 0: return False
     parent = cache.common_parent
     if parent == None: return False
     while not parent.check_add(Point):
         parent = parent.parent
         if parent == None: return False
     # C) passed all tests:
     return True
Esempio n. 55
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     if cache.node is None: return False
     contains_atoms = False
     for cls in cache.child_classes:
         if issubclass(cls, Atom):
             contains_atoms = True
             break
     if not contains_atoms: return False
     # C) passed all tests
     return True
Esempio n. 56
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     Atom = context.application.plugins.get_node("Atom")
     if not isinstance(cache.node, GLContainerMixin): return False
     some_atoms = False
     for cls in cache.child_classes:
         if issubclass(cls, Atom):
             some_atoms = True
             break
     if not some_atoms: return False
     # C) passed all tests:
     return True
Esempio n. 57
0
 def analyze_selection():
     # A) calling ancestor
     if not Immediate.analyze_selection(): return False
     # B) validating
     cache = context.application.cache
     Atom = context.application.plugins.get_node("Atom")
     if not isinstance(cache.node, GLContainerMixin): return False
     some_atoms = False
     for cls in cache.child_classes:
         if issubclass(cls, Atom):
             some_atoms = True
             break
     if not some_atoms: return False
     # C) passed all tests:
     return True
Esempio n. 58
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     if len(context.application.cache.nodes) == 0: return False
     return True
Esempio n. 59
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     if not isinstance(context.application.cache.node, ContainerMixin):
         return False
     return True
Esempio n. 60
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     if len(context.application.cache.nodes) == 0: return False
     return True