Revised patch for adding version info for Extensions
Jan-Oliver Wagner
jan at intevation.de
Sun Sep 19 00:11:28 CEST 2004
Hi,
here is the revised patch for extension descriptions.
Now OK to commit? (Will also baclport to 1_0)
Jan
--
Jan-Oliver Wagner http://intevation.de/~jan/
Intevation GmbH http://intevation.de/
FreeGIS http://freegis.org/
-------------- next part --------------
Index: gns2shp.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/gns2shp/gns2shp.py,v
retrieving revision 1.3
diff -u -3 -p -r1.3 gns2shp.py
--- gns2shp.py 18 May 2004 21:09:50 -0000 1.3
+++ gns2shp.py 18 Sep 2004 22:07:02 -0000
@@ -23,7 +23,7 @@ __version__ = '$Revision: 1.3 $'
import os, sys
-# only import GUI when not called as command line tool
+# only import GUI and register when not called as command line tool
if __name__ != '__main__':
from wxPython.wx import *
@@ -32,8 +32,21 @@ if __name__ != '__main__':
from Thuban import _
from Thuban.Model.layer import Layer
+from Thuban.UI.extensionregistry import ExtensionDesc, ext_registry
+
import shapelib
import dbflib
+
+
+ext_registry.add(ExtensionDesc(
+ name = 'gns2shp',
+ version = '1.0.0',
+ authors= [ 'Jan-Oliver Wagner' ],
+ copyright = '2003, 2004 Intevation GmbH',
+ desc = _("Converts GNS (Geographical Name Service\n" \
+ "of NIMA) to Shapefile format and\n" \
+ "displays the data.")))
+
def gns2shp(src_fname, dest_fname):
"""Convert a file from gns textformat into a Shapefile.
Index: importAPR.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/importAPR/importAPR.py,v
retrieving revision 1.4
diff -u -3 -p -r1.4 importAPR.py
--- importAPR.py 11 May 2004 22:34:49 -0000 1.4
+++ importAPR.py 18 Sep 2004 22:07:56 -0000
@@ -27,9 +27,18 @@ from Thuban.UI.mainwindow import main_me
from Thuban import _
from Thuban.Model.layer import Layer
from Thuban.Model.classification import ClassGroupRange, ClassGroupSingleton
+from Thuban.UI.extensionregistry import ExtensionDesc, ext_registry
from odb import ODBBaseObject
from apr import APR_LClass, APR_TClr, APR_BLnSym, APR_BMkSym, APR_BShSym
+
+ext_registry.add(ExtensionDesc(
+ name = 'importAPR',
+ version = '0.1.0',
+ authors= [ 'Jan-Oliver Wagner' ],
+ copyright = '2003 Intevation GmbH',
+ desc = _("Import a ArcView project file (.apr)\n" \
+ "and convert it to Thuban.")))
class ODBExtension(Extension):
def TreeInfo(self):
Index: about.py
===================================================================
RCS file: /thubanrepository/thuban/Thuban/UI/about.py,v
retrieving revision 1.15
diff -u -3 -p -r1.15 about.py
--- about.py 20 Aug 2004 16:50:22 -0000 1.15
+++ about.py 18 Sep 2004 22:08:21 -0000
@@ -21,6 +21,8 @@ from Thuban import _
from Thuban.version import versions
from Thuban.Model.resource import gdal_support_status
+from Thuban.UI.extensionregistry import ext_registry
+
class About(wxDialog):
def __init__(self, parent):
@@ -73,6 +75,14 @@ class About(wxDialog):
text+= '\t%s %s\n' % (name, version)
text += '\n'
+ text += _('Extensions:\n')
+ if ext_registry:
+ for ext in ext_registry:
+ text += '\t%s %s\n' % (ext.name, ext.version)
+ else:
+ text += _('\tNone registered.\n')
+ text += '\n'
+
text += _('Lead Developer:\n')
text += '\t%s\n\n' % lead_developer
@@ -97,6 +107,22 @@ class About(wxDialog):
"\tDevelopers list (public):\n\t\t<thuban-devel at intevation.de>\n"
"\tThuban team at Intevation:\n\t\t<thuban at intevation.de>\n"
)
+
+ text += '\n\n'
+
+ text += _("Details on the registered extensions:\n\n")
+
+ if ext_registry:
+ for ext in ext_registry:
+ text += '%s %s:\n' % (ext.name, ext.version)
+ text += _('Copyright %s\n') % ext.copyright
+ text += _('Authors:\n')
+ for author in ext.authors:
+ text+= '\t%s\n' % author
+ text += ext.desc
+ text += '\n\n'
+ else:
+ text += _('\tNone registered.\n')
self.text = text
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extensionregistry.py
Type: text/x-python
Size: 2384 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20040919/e3906814/extensionregistry.py
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)