(self, node)
return
# remove entry from schema
        schema = Schema.get()
        xml = schema.get_xml()
        node = xml.get_node("schema/search_type[@name='%s']" % search_type)
        if node != None:
            parent = xml.get_parent(node)
            xml.remove_child(parent, node)
            schema.set_value('schema', xml.to_string() )
            schema.commit()

        # remove search type entry
        if search_type.startswith("config/") or search_type.startswith("sthpw/"):
            print("WARNING: A plugin cannot deregister a search type from the 'sthpw' or 'config' namespace'")
        else:

            search = Search("sthpw/search_object")
            search.add_filter("search_type", search_type)
            search_type_sobj = search.get_sobject()
            if search_type_sobj:
                search_type_sobj.delete()
# remove entry from schema
        schema = Schema.get()
        xml = schema.get_xml()
        node = xml.get_node("schema/search_type[@name='%s']" % search_type)
        if node != None:
            parent = xml.get_parent(node)
            xml.remove_child(parent, node)
            schema.set_value('schema', xml.to_string() )
            schema.commit()
# remove entry from schema schema = Schema . get () xml = schema . get_xml () node = xml . get_node ( schema / search_type [ @name = %s ] % search_type ) if node ! = None : parent = xml . get_parent ( node ) xml . remove_child ( parent node ) schema . set_value ( schema xml . to_string () ) schema . commit ()
def _remove_search_type(self, node):
        search_type = Xml.get_attribute(node, 'code')

        # get sobject entry
        search = Search("sthpw/search_object")
        search.add_filter("search_type", search_type)
        search_type_sobj = search.get_sobject()

        if not search_type_sobj:
            print("WARNING: Search type [%s] does not exist" % search_type)
            return


        # dump the table data into backup folder
        backup_path = "backup/%s.spt" % search_type.replace("/", "_")
        full_backup_path = "%s/%s" % (self.plugin_dir, backup_path)

        if os.path.exists(full_backup_path):
            os.unlink(full_backup_path)

        tools = PluginTools(plugin_dir=self.plugin_dir)
        tools.dump_sobject(search_type, backup_path)


        # get the table and remove it
        from pyasm.search import DropTable
        try:
            table_drop = DropTable(search_type)
            table_drop.commit()
            # NOTE: do we need to log the undo for this?
        except Exception as e:
            print("Error: ", e.message)


        # NOTE: it is not clear that unloading a plugin should delete
        # the search type ... this search type (at present) can be
        # shared amongst multiple projects and this will break it
        return

        """
        # remove entry from schema
        schema = Schema.get()
        xml = schema.get_xml()
        node = xml.get_node("schema/search_type[@name='%s']" % search_type)
        if node != None:
            parent = xml.get_parent(node)
            xml.remove_child(parent, node)
            schema.set_value('schema', xml.to_string() )
            schema.commit()

        # remove search type entry
        if search_type.startswith("config/") or search_type.startswith("sthpw/"):
            print("WARNING: A plugin cannot deregister a search type from the 'sthpw' or 'config' namespace'")
        else:

            search = Search("sthpw/search_object")
            search.add_filter("search_type", search_type)
            search_type_sobj = search.get_sobject()
            if search_type_sobj:
                search_type_sobj.delete()
        """
def _remove_search_type ( self , node ) : search_type = Xml . get_attribute ( node , 'code' ) # get sobject entry search = Search ( "sthpw/search_object" ) search . add_filter ( "search_type" , search_type ) search_type_sobj = search . get_sobject ( ) if not search_type_sobj : print ( "WARNING: Search type [%s] does not exist" % search_type ) return # dump the table data into backup folder backup_path = "backup/%s.spt" % search_type . replace ( "/" , "_" ) full_backup_path = "%s/%s" % ( self . plugin_dir , backup_path ) if os . path . exists ( full_backup_path ) : os . unlink ( full_backup_path ) tools = PluginTools ( plugin_dir = self . plugin_dir ) tools . dump_sobject ( search_type , backup_path ) # get the table and remove it from pyasm . search import DropTable try : table_drop = DropTable ( search_type ) table_drop . commit ( ) # NOTE: do we need to log the undo for this? except Exception as e : print ( "Error: " , e . message ) # NOTE: it is not clear that unloading a plugin should delete # the search type ... this search type (at present) can be # shared amongst multiple projects and this will break it return