当前位置: 首页>>代码示例>>Python>>正文


Python EditCommand.keep_empty_group方法代码示例

本文整理汇总了Python中command_support.EditCommand.EditCommand.keep_empty_group方法的典型用法代码示例。如果您正苦于以下问题:Python EditCommand.keep_empty_group方法的具体用法?Python EditCommand.keep_empty_group怎么用?Python EditCommand.keep_empty_group使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在command_support.EditCommand.EditCommand的用法示例。


在下文中一共展示了EditCommand.keep_empty_group方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: keep_empty_group

# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import keep_empty_group [as 别名]
    def keep_empty_group(self, group):
        """
        Returns True if the empty group should not be automatically deleted. 
        otherwise returns False. The default implementation always returns 
        False. Subclasses should override this method if it needs to keep the
        empty group for some reasons. Note that this method will only get called
        when a group has a class constant autdelete_when_empty set to True. 
        (and as of 2008-03-06, it is proposed that dna_updater calls this method
        when needed. 
        @see: Command.keep_empty_group() which is overridden here. 
        """

        bool_keep = EditCommand.keep_empty_group(self, group)

        if not bool_keep: 
            #Don't delete any DnaSegements or DnaGroups at all while 
            #in DnaDuplex_EditCommand. 
            #Reason: See BreakStrand_Command.keep_empty_group. In addition to 
            #this, this command can create multiple DnaSegments Although those 
            #won't be empty, it doesn't hurt in waiting for this temporary 
            #command to exit before deleting any empty groups.             
            if isinstance(group, self.assy.DnaSegment) or \
               isinstance(group, self.assy.DnaGroup):
                bool_keep = True

        return bool_keep
开发者ID:ematvey,项目名称:NanoEngineer-1,代码行数:28,代码来源:DnaDuplex_EditCommand.py

示例2: keep_empty_group

# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import keep_empty_group [as 别名]
    def keep_empty_group(self, group):
        """
        Returns True if the empty group should not be automatically deleted.
        otherwise returns False. The default implementation always returns
        False. Subclasses should override this method if it needs to keep the
        empty group for some reasons. Note that this method will only get called
        when a group has a class constant autdelete_when_empty set to True.
        (and as of 2008-03-06, it is proposed that dna_updater calls this method
        when needed.
        @see: Command.keep_empty_group() which is overridden here.
        """

        bool_keep = EditCommand.keep_empty_group(self, group)

        if not bool_keep:
            #Lets just not delete *ANY* DnaGroup while in DnaDisplayStyle_Command
            #Although DnaDisplayStyle command can only be accessed through
            #BuildDna_EditCommand, it could happen (due to a bug) that the
            #previous command is not BuildDna_Editcommand. So bool_keep
            #in that case will return False propmting dna updater to even delete
            #the empty DnaGroup (if it becomes empty for some reasons) of the
            #BuildDna command. To avoid this ,this method will instruct
            # to keep all instances of DnaGroup even when they might be empty.
            if isinstance(group, self.assy.DnaGroup):
                bool_keep = True
            #Commented out code that shows what I was planning to implement
            #earlier.
            ##previousCommand = self.commandSequencer.prevMode # keep_empty_group: .struct
            ##if previousCommand.commandName == 'BUILD_DNA':
                ##if group is previousCommand.struct:
                    ##bool_keep = True

        return bool_keep
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:35,代码来源:DnaDisplayStyle_Command.py

示例3: keep_empty_group

# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import keep_empty_group [as 别名]
    def keep_empty_group(self, group):
        """
        Returns True if the empty group should not be automatically deleted. 
        otherwise returns False. The default implementation always returns 
        False. Subclasses should override this method if it needs to keep the
        empty group for some reasons. Note that this method will only get called
        when a group has a class constant autdelete_when_empty set to True. 
        (and as of 2008-03-06, it is proposed that dna_updater calls this method
        when needed. 
        @see: Command.keep_empty_group() which is overridden here. 
        @see: BreakStrands_Command.keep_empty_group
        @see: Group.autodelete_when_empty.. a class constant used by the 
              dna_updater (the dna updater then decides whether to call this 
              method to see which empty groups need to be deleted)
        """

        bool_keep = EditCommand.keep_empty_group(self, group)

        if not bool_keep:
            if self.hasValidStructure():
                if group is self.struct:
                    bool_keep = True
                elif group is self.struct.parent_node_of_class(self.assy.DnaGroup):
                    bool_keep = True
            # If this command doesn't have a valid structure, as a fall back,
            # lets instruct it to keep ALL the DnaGroup objects even when empty
            # Reason? ..see explanation in BreakStrands_Command.keep_empty_group
            elif isinstance(group, self.assy.DnaGroup):
                bool_keep = True

        return bool_keep
开发者ID:elfion,项目名称:nanoengineer,代码行数:33,代码来源:DnaSegment_EditCommand.py

示例4: keep_empty_group

# 需要导入模块: from command_support.EditCommand import EditCommand [as 别名]
# 或者: from command_support.EditCommand.EditCommand import keep_empty_group [as 别名]
    def keep_empty_group(self, group):
        """
        Returns True if the empty group should not be automatically deleted.
        otherwise returns False. The default implementation always returns
        False. Subclasses should override this method if it needs to keep the
        empty group for some reasons. Note that this method will only get called
        when a group has a class constant autdelete_when_empty set to True.
        @see: Command.keep_empty_group() which is overridden here.
        """

        bool_keep = EditCommand.keep_empty_group(self, group)

        return bool_keep
开发者ID:alaindomissy,项目名称:nanoengineer,代码行数:15,代码来源:FixedBBProteinSim_Command.py


注:本文中的command_support.EditCommand.EditCommand.keep_empty_group方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。