[Qgis-developer] qgis-1.5.0_coding-compilation_guide_en.pdf

Benoit de Cabissole benoit at exigesa.com
Sun Aug 22 09:45:53 EDT 2010


Hello Manual Team,

With reference to the subject and to recent discussions in this forum
regarding plugins coding standard:
- on page 29, the __init__.py example (at the bottom of the page) could be
rewritten as:

# -*- coding: utf-8 -*-
def name():
    return "FOSS4G example"
def description():
    return "A simple example plugin to load shapefiles"
def version():
    return "0.1"
def qgisMinimumVersion():
    return "1.0"
def authorName():
    return "John Developer"
def classFactory(iface):
    from foss4gplugin import FOSS4GPlugin
    return FOSS4GPlugin(iface)

Where the import line is put inside the classFactory() function and not in
the first line of the file.

Just trying my two bits for consistency...

Cheers and keep the good work,
Benoit



More information about the Qgis-developer mailing list