KDE 4.5 PyKDE API Reference

- KDE's Python API

# PluginManager Class Reference

`from PyKDE4.soprano import *`

Inherits: QObject
Namespace: Soprano

## Detailed Description

\class PluginManager pluginmanager.h Soprano/PluginManager

The PluginManager loads and maintains all %Soprano plugins.

Normally there is no need to use this class as all important methods have global counterparts in the Soprano namespace.

\sa soprano_writing_plugins

Author:
  Sebastian Trueg <trueg@kde.org>

## Methods
| __init__ (self, QObject parent=0)
[Soprano.Backend] | allBackends (self)
[Soprano.Parser] | allParsers (self)
[Soprano.Serializer] | allSerializers (self)
Soprano.Backend | discoverBackendByFeatures (self, Soprano.BackendFeatures features, QStringList userFeatures=QStringList())
Soprano.Backend | discoverBackendByName (self, QString name)
Soprano.Parser | discoverParserByName (self, QString name)
Soprano.Parser | discoverParserForSerialization (self, Soprano.RdfSerialization serialization, QString userSerialization=QString())
Soprano.Serializer | discoverSerializerByName (self, QString name)
Soprano.Serializer | discoverSerializerForSerialization (self, Soprano.RdfSerialization serialization, QString userSerialization=QString())
Soprano.Backend | loadCustomBackend (self, QString path)
Soprano.Parser | loadCustomParser (self, QString path)
bool | loadCustomPlugin (self, QString path)
Soprano.Serializer | loadCustomSerializer (self, QString path)
| setPluginSearchPath (self, QStringList path, bool useDefaults=1)
## Static Methods
Soprano.PluginManager | instance ()

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

[Soprano.Backend] allBackends | ( |  | self ) |

[Soprano.Parser] allParsers | ( |  | self ) |

[Soprano.Serializer] allSerializers | ( |  | self ) |

Soprano.Backend discoverBackendByFeatures | ( | self, |
|  | Soprano.BackendFeatures | features,
|  | QStringList | userFeatures=QStringList()
| ) |  |  |

Find a backend plugin by its features.

Parameters:

  | features | The features that are requested, a combination of Soprano.BackendFeature flags.

Parameters:

  | userFeatures | If features contain Backend.BackendFeatureUser this paramter states the additionally requested user features.

Returns:
  a Backend that supports the features defined in features.

Soprano.Backend discoverBackendByName | ( | self, |
|  | QString | name
| ) |  |  |

Find a backend plugin by its name.

Returns:
  the backend specified by name or null if could not be found.

Soprano.Parser discoverParserByName | ( | self, |
|  | QString | name
| ) |  |  |

Find a parser plugin by its name.

Returns:
  the parser specified by name or null if could not be found.

Soprano.Parser discoverParserForSerialization | ( | self, |
|  | Soprano.RdfSerialization | serialization,
|  | QString | userSerialization=QString()
| ) |  |  |

Find a Parser instance that is able to parse RDF data serialized as serialization.

Parameters:

  | serialization | The requested serialization.

Parameters:

  | userSerialization | If serialization is set to Soprano.SerializationUser this parameter specifies the serialization to use. It allows the extension of the %Soprano Parser interface with new RDF serializations that are not officially supported by %Soprano.

Returns:
  A Parser plugin that can parse RDF data encoded in the requested serialization or 0 if no such plugin could be found.

Soprano.Serializer discoverSerializerByName | ( | self, |
|  | QString | name
| ) |  |  |

Find a serializer plugin by its name.

Returns:
  the serializer specified by name or null if could not be found.

Soprano.Serializer discoverSerializerForSerialization | ( | self, |
|  | Soprano.RdfSerialization | serialization,
|  | QString | userSerialization=QString()
| ) |  |  |

Find a Serializer instance that is able to encode RDF data using serialization.

Parameters:

  | serialization | The requested serialization.

Parameters:

  | userSerialization | If serialization is set to Soprano.SerializationUser this parameter specifies the serialization to use. It allows the extension of the %Soprano Serializer interface with new RDF serializations that are not officially supported by %Soprano.

Returns:
  A Serializer plugin that can serialize RDF data encoded in the requested serialization or 0 if no such plugin could be found.

Soprano.Backend loadCustomBackend | ( | self, |
|  | QString | path
| ) |  |  |

Load a custom Backend plugin from a library at the specified path.

Parameters:

  | path | The path to the library file that contains the plugin.

PluginManager uses the name the plugin provides (Plugin.pluginName) to manage the plugin.

Returns:
  The loaded Backend plugin or 0 in case no suported plugin could be found at path or the found plugin is not a backend.

Since:
  2.3

Soprano.Parser loadCustomParser | ( | self, |
|  | QString | path
| ) |  |  |

Load a custom Parser plugin from a library at the specified path.

Parameters:

  | path | The path to the library file that contains the plugin.

PluginManager uses the name the plugin provides (Plugin.pluginName) to manage the plugin.

Returns:
  The loaded Parser plugin or 0 in case no suported plugin could be found at path or the found plugin is not a backend.

Since:
  2.3

bool loadCustomPlugin | ( | self, |
|  | QString | path
| ) |  |  |

Load a custom plugin from a library at the specified path.

Parameters:

  | path | The path to the library file that contains the plugin. Be aware that plugins loaded via this method do not need a desktop file as described

PluginManager uses the name the plugin provides (Plugin.pluginName) to manage the plugin.

Returns:
  true if the plugin could be loaded successfully, false if no suported plugin could be found at path.

Since:
  2.3

Soprano.Serializer loadCustomSerializer | ( | self, |
|  | QString | path
| ) |  |  |

Load a custom Serializer plugin from a library at the specified path.

Parameters:

  | path | The path to the library file that contains the plugin.

PluginManager uses the name the plugin provides (Plugin.pluginName) to manage the plugin.

Returns:
  The loaded Serializer plugin or 0 in case no suported plugin could be found at path or the found plugin is not a backend.

Since:
  2.3

setPluginSearchPath | ( | self, |
|  | QStringList | path,
|  | bool | useDefaults=1
| ) |  |  |

Set the plugin search path. The PluginManager searches a set of folders for installed plugins. Here a plugin consists of a desktop file describing it and the actual plugin library file. For loading custom plugins manually see loadCustomPlugin.

Parameters:

  | path | The folders that PluginManager should search for plugin description files.

Parameters:

  | useDefaults | If true PluginManager will also search the default plugin paths

\sa soprano_writing_plugins

Since:
  2.3

## Static Method Documentation

Soprano.PluginManager instance | ( |  | ) |

Get the singleton instance of the PluginManager