def remove_permanent_connection(cls, connection): """ Removes a permanent connection. """ cls.check_permanent_connections() for i, connection2 in enumerate(cls.permanent_connections): if connection == connection2: del cls.permanent_connections[i] facet_db.set(PermanentConnections, cls.permanent_connections) break
def save_state ( self ): """ Saves the current state of the plugin. """ values = self.dock_control.object.get( *self.names ) for name, value in values.items(): if isinstance( value, FacetListObject ): values[ name ] = list( value ) elif isinstance( value, FacetSetObject ): values[ name ] = set( value ) elif isinstance( value, FacetDictObject ): values[ name ] = dict( value ) facet_db.set( self.id, values )
def remove_permanent_connection ( self, connection ): """ Removes a permanent connection. """ connections = ConnectFeature.get_permanent_connections( self.context ) for i, connection2 in enumerate( connections ): if connection == connection2: del connections[ i ] if len( connections ) == 0: facet_db.set( self.context ) else: facet_db.set( self.context, connections ) break
def add_permanent_connection(cls, connection): """ Adds a permanent connection. """ cls.check_permanent_connections() cls.permanent_connections.append(connection.clone()) facet_db.set(PermanentConnections, cls.permanent_connections)
def add_permanent_connection ( self, connection ): """ Adds a permanent connection. """ connections = ConnectFeature.get_permanent_connections( self.context ) connections.append( connection.clone() ) facet_db.set( self.context, connections )
# Imports: #------------------------------------------------------------------------------- from facets.api \ import Theme from facets.core.facet_db \ import facet_db #------------------------------------------------------------------------------- # Define the standard themes: #------------------------------------------------------------------------------- # item_theme to use for a ScrubberEditor: facet_db.set( '#themes:ScrubberEditor', Theme( '@xform:e4?H53L18S28', content = ( 0, 0, -2, -4 ) ) ) # group_theme to use for a tool's 'options' view: facet_db.set( '#themes:tool_options_group', Theme( '@xform:b?L40' ) ) # group_theme to use for an embedded toolbar: facet_db.set( '#themes:toolbar_group', Theme( '@xform:b?L10' ) ) # group_theme to use for an embedded toolbar: facet_db.set( '#themes:toolbar', Theme( '@xform:b?L30' )
def delete ( self ): """ Deletes the 'id' from the facet database. """ facet_db.set( self.id, db = self.database )