Exemplo n.º 1
0
    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
Exemplo n.º 2
0
    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 )
Exemplo n.º 3
0
    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
Exemplo n.º 4
0
 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)
Exemplo n.º 5
0
 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 )
Exemplo n.º 6
0
#  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' )
Exemplo n.º 7
0
 def delete ( self ):
     """ Deletes the 'id' from the facet database.
     """
     facet_db.set( self.id, db = self.database )