1 |
# Copyright (C) 2003 by Intevation GmbH |
# Copyright (C) 2003-2004 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Frank Koormann <[email protected]> |
# Frank Koormann <[email protected]> |
4 |
# |
# |
14 |
""" |
""" |
15 |
|
|
16 |
__version__ = '$Revision$' |
__version__ = '$Revision$' |
17 |
|
# $Source$ |
18 |
|
# $Id$ |
19 |
|
|
20 |
import os, sys |
import os, sys |
21 |
import string |
import string |
26 |
from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor |
from Thuban.UI.common import ThubanBeginBusyCursor, ThubanEndBusyCursor |
27 |
from Thuban.UI.command import registry, Command |
from Thuban.UI.command import registry, Command |
28 |
from Thuban.UI.mainwindow import main_menu, _has_selected_shape_layer |
from Thuban.UI.mainwindow import main_menu, _has_selected_shape_layer |
29 |
|
from Thuban.UI.extensionregistry import ExtensionDesc, ext_registry |
30 |
from Thuban import _ |
from Thuban import _ |
31 |
|
|
32 |
import shapelib |
import shapelib |
33 |
import dbflib |
import dbflib |
34 |
|
|
35 |
|
ext_registry.add(ExtensionDesc( |
36 |
|
name = 'bboxdump', |
37 |
|
version = '1.0.0', |
38 |
|
authors= [ 'Frank Koormann' ], |
39 |
|
copyright = '2003-2004 Intevation GmbH', |
40 |
|
desc = _("Dumps the bounding boxes of all\n" \ |
41 |
|
"shapes of the selected layer."))) |
42 |
|
|
43 |
# Widget IDs |
# Widget IDs |
44 |
ID_FILENAME = 4001 |
ID_FILENAME = 4001 |
45 |
ID_ATTRIBUTES = 4002 |
ID_ATTRIBUTES = 4002 |
247 |
sensitive = _has_selected_shape_layer)) |
sensitive = _has_selected_shape_layer)) |
248 |
|
|
249 |
# find the extensions menu (create it anew if not found) |
# find the extensions menu (create it anew if not found) |
250 |
extensions_menu = main_menu.find_menu('extensions') |
extensions_menu = main_menu.FindOrInsertMenu('extensions', _('E&xtensions')) |
|
if extensions_menu is None: |
|
|
extensions_menu = main_menu.InsertMenu('extensions', _('E&xtensions')) |
|
251 |
|
|
252 |
# finally add the new entry to the extensions menu |
# finally add the new entry to the extensions menu |
253 |
extensions_menu.InsertItem('bboxdump') |
extensions_menu.InsertItem('bboxdump') |