Пример #1
0
    def __can_delete_condition(self, class_name):
        usage_log = usagelog.find_transition_condition( class_name )
        if len( usage_log[1] ) > 0:
            dlg = usagelog.DeleteErrorDialog(
                app.get_top_window(),
                "transition condition '" + class_name + "'",
                usage_log
                )
            dlg.Show()
            return False
        
        # Save FSMs to avoid inconsistences between memory and persisted states
        # (and make the previous check valid)
        delete = self.__save_fsms('transition condition')

        # Delete the singleton condition instance so the class can be deleted
        if delete:
            cond_path = format.append_to_path(
                                fsm.get_script_conditions_lib(), 
                                class_name 
                                )
            try:
                pynebula.delete( str(cond_path) )
            except:
                pass
        
        return delete
Пример #2
0
    def __can_delete_condition(self, class_name):
        usage_log = usagelog.find_transition_condition(class_name)
        if len(usage_log[1]) > 0:
            dlg = usagelog.DeleteErrorDialog(
                app.get_top_window(),
                "transition condition '" + class_name + "'", usage_log)
            dlg.Show()
            return False

        # Save FSMs to avoid inconsistences between memory and persisted states
        # (and make the previous check valid)
        delete = self.__save_fsms('transition condition')

        # Delete the singleton condition instance so the class can be deleted
        if delete:
            cond_path = format.append_to_path(fsm.get_script_conditions_lib(),
                                              class_name)
            try:
                pynebula.delete(str(cond_path))
            except:
                pass

        return delete
Пример #3
0
 def __init__(self, parent):
     ScriptsLibraryDialog.__init__(self, parent,
         fsm.get_script_conditions_lib(),
         fsm.get_script_conditions_lib(False),
         'nscriptcondition', "condition script")
     pass