示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#8
0
    def analyze_selection():
        # A) calling ancestor
        if not Immediate.analyze_selection(): return False
        # B) validating

        # C) passed all tests:
        return True
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#47
0
文件: atom.py 项目: molmod/zeobuilder
 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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#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
示例#57
0
文件: atom.py 项目: molmod/zeobuilder
 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
示例#58
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     if len(context.application.cache.nodes) == 0: return False
     return True
示例#59
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     if not isinstance(context.application.cache.node, ContainerMixin):
         return False
     return True
示例#60
0
 def analyze_selection():
     if not Immediate.analyze_selection(): return False
     if len(context.application.cache.nodes) == 0: return False
     return True