Exemple #1
0
    def __can_delete_selector(self, class_name):
        usage_log = usagelog.find_fsm_selector( class_name )
        if len( usage_log[1] ) > 0:
            dlg = usagelog.DeleteErrorDialog(
                app.get_top_window(),
                "FSM selector '" + 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('FSM selector')
        
        # Delete the singleton selector instance so the class can be deleted
        if delete:
            selector_path = format.append_to_path(
                                    fsm.get_fsm_selectors_lib(), 
                                    class_name 
                                    )
            try:
                pynebula.delete( str(selector_path) )
            except:
                pass
        return delete
Exemple #2
0
    def __can_delete_selector(self, class_name):
        usage_log = usagelog.find_fsm_selector(class_name)
        if len(usage_log[1]) > 0:
            dlg = usagelog.DeleteErrorDialog(
                app.get_top_window(), "FSM selector '" + 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('FSM selector')

        # Delete the singleton selector instance so the class can be deleted
        if delete:
            selector_path = format.append_to_path(fsm.get_fsm_selectors_lib(),
                                                  class_name)
            try:
                pynebula.delete(str(selector_path))
            except:
                pass
        return delete
Exemple #3
0
 def __init__(self, parent):
     ScriptsLibraryDialog.__init__(self, parent,
         fsm.get_fsm_selectors_lib(), fsm.get_fsm_selectors_lib(False),
         'nfsmselector', "FSM selection script")
     pass