Version 24 (modified by nopper, 4 years ago)

--

UMIT Plugins Project

Abstract

Plugins are useful to implement indipendent features that could help the user to customize the umit experience. The goal of this project is to let user extend easily Umit, and implement a window like firefox to manage the plugins:

  • install
  • uninstall
  • disable
  • download
  • upload? (on addons.umitproject.org that hosts all the plugins)

With a Plugin object the user can access to the toolbar, to the windows or to the nmnap output, in order to customize the gui or to interpretate the results in different way from the original.

Plugin Format

Plugins are packed in a zip file so we can easily distribute without band overhead and use the import statement to load python source code files stored into the archive.

A plugin have a simply directory tree structure:

  1. bin/ containing the py | so file (see also star_file)
  2. lib/ containing various libraries (py or so files)
  3. data/ containing dist files like logo, default configurations, etc.
  4. locale/ containing locale files (.mo and related)
  5. a Manifest.xml file on top directory that contains meta-informations (like needs, provides, conflicts, etc.)
  6. a data/logo.png file that's the image to be presented in the Plugin Manager Window (GUI)

Manifest.xml file

It's a simple xml file containing meta-information.

Example:

<?xml version="1.0" ?>
<UmitPlugin>
  <url>http://snippets.pornosecurity.org</url>
  <conflicts></conflicts>
  <provides>&gt;=SystemInfo-1.0</provides>
  <needs></needs><type></type>
  <start_file>main</start_file>
  <name>SystemInfo</name>
  <version>0.1</version>
  <description>A plugin that provides info about the system</description>
  <author>Francesco Piccinno</author>
  <license>GPL</license>
  <update>http://localhost/~stack/plugins/systeminfo</update>
</UmitPlugin>

Fields could be:

  • needs (a list of needed virtual plugins that must be present to load the current plugin)
  • conflicts (a list of conflicting virtual plugins that must be *NOT* present to load the current plugin)
  • provides (a list of exported virtual that the current plugin provides to the others)
  • start-file (a string representing the main file in source directory)
  • url (a link to the plugins' homepage)
  • author (the name of the author)
  • license (the license used for plugin)
  • name (a non-op version-string describing the plugin)
  • update (a link to the plugins' update directory)
  • description (a plugin description)
  • version (the plugin's version
  • contributors
  • translators
  • artists
  • license

Version Strings

Fields like needs, conflicts, provides and name are version-string. EBNF/regex for op and non-op version strings:

Op version string := <operator><name><version>

<operator> := '<' | '<=' | '>' | '>=' | '=' | '!'
<name> := [a-zA-Z0-9]{1,}
<version> := '-' (\d\.?){1,3}

Non-op version string := <name><version>

<name> := [a-zA-Z0-9]{1,}
<version> := '-' (\d\.?){1,3}

Examples of version strings are:

Op version strings:
  >dummy-1.0
  <=woot-2.2.3

Non-op version strings:
  foobar-3.0
  foofoo-2.2.1

Web Update Process

If a plugin provide the update field Umit will try to contact that url to manage the update. For example if we have a plugin with update field setted to http://www.umitproject.org/plugins/dummy/ UMIT will try to get a latest.xml file from this location http://www.umitproject.org/plugins/dummy/latest.xml.

Latest.xml file

<UmitPluginUpdate>
    <update-uri>http://localhost/~stack/plugins/systeminfo/SystemInfo.ump</update-uri>
    <version>2.0.0</version>
    <md5>c7487b08545f58999512f6155852050e</md5>
</UmitPluginUpdate>
  • The <UmitPluginUpdate> is the signature for the file. In absence of this tag the file is treated as not valid and then discarded.
  • The <update-uri> tag provides the url where the real plugin update is located.
  • The <version> tag describe the version that is present at update-uri location
  • The <md5> (optional) provide an hash to verify the correctness of the download

Core Functions

The core object, that is a singleton GObject, accesible from plugin contains various funcionts that permits plugin to communicate with UMIT. It provides various signals, functions and getters.

Signals

This signals have the same type (TYPE_NONE, (TYPE_OBJECT)) where the object passed is the ScanHostView/ScanResultNotebook/ScanNotebookPage that emits the signals respectively. These signals don't influence the program flow.

  • ScanHostsView-created fired when a ScanHostView? object is created
  • ScanResultNotebook-created fired when a ScanResultNotebook? object is created
  • ScanNotebookPage-created fired when a ScanNotebookPage? object is created
    • The ScanNotebook? object provides another signal called scan-finished of the type (TYPE_NONE, ()) fired when a scan is finished

Functions

Functions that Core provides:

  • open_url(link) that opens the default browser at link location
  • get_need(reader, needstr, classname=None, need_module=False) that returns an instance of the class classname (optional) of the plugin that provides needstr or the respective module if need_module is True

Getters

Core has a field called mainwindow that returns the MainWindow? instance of UMIT. From that you could reach any public object (see also MainWindow?.py source code) Core also provides convenient functions to get general widgets:

Screenshots

Plugin manager on Linux

Help system on Windows

Windows preview

Source code

Testing

Linux

First check out the code

svn co http://svn.umitproject.org/svnroot/umit/branch/UmitPlugins
cd UmitPlugins/
cd source-plugins/
python builder.py
cd ../
python umit

Then from Menu press Tools -> Extensions, select Paths from the 'Plugin Manager' window. Click on add and chose the directory plugins under your current working directory (the dir where the .ump files are located). Then click save, restart UMIT and enjoy :)

Windows

Dependencies:

After installing all the stuff you need to set PATH environ variable for MinGW (C:\mingw\bin) and Python (C:\Python25) to properly build c extensions.

Then checkout the sources from http://svn.umitproject.org/svnroot/umit/branch/UmitPlugins, then enter in UmitPlugins directory with a command prompt and type:

cd source-plugins
python builder.py
cd ..
python umit

Videos

Widgets used

Videos are in ogg/theora format

Attachments