I am working with python plugins for QGIS.I developed my plugin and inorder to incooperate the same into QGIS i copied the folder in

C:\Documents and Settings\comp90\.qgis\python\plugins

I opened my QGIS exe and installed the same.It is shown under **Databases-->PG & SL. My code is as follows:

SUPPORTED_CONNECTORS = {'postgis':'1.5', 'spatialite':'1.6'}

def listDatabases(self):

    actionsDb = {}
    actions = DbConnection.ConnectionManager.getAvailableConnections()

    for a in actions:
        actionsDb[ unicode(a.text()) ] = a

    return actionsDb

def getAvailableConnections(self, conntypes=None):

    if conntypes == None:

        conntypes = ConnectionManager.SUPPORTED_CONNECTORS.keys()
    if not hasattr(conntypes, '__iter__'):
        conntypes = [conntypes]

    connections = []
    for c in conntypes:
        connection = self.getConnection( c )
        connections.extend( connection.getAvailableConnections() )
    return connections

def getAvailableConnections(self):
    connections = []

    settings = QSettings()
    settings.beginGroup( "/%s/connections" % self.getSettingsKey() )
    keys = settings.childGroups()
    for name in keys:
        connections.append( Connection.ConnectionAction(name, self.getTypeName()) )

    return connections

but the actionsDb is blank.In QGIS, the connection is established. When I try to open the plugin in QGIS ,it does not open because actionsDb is blank. What can be the problem??

  • I'm a bit confused. Are you having trouble with RT Sql Layer or with your own plugin? – underdark Feb 16 '12 at 9:09
  • 1
    For this kind of problems try also the qgis-developer mailing list. – Giovanni Manghi Feb 16 '12 at 9:10
  • @underdark---With my own plugins.... – PNM Feb 16 '12 at 9:29
  • I don't think we can help without seeing your code. – underdark Feb 16 '12 at 17:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.