~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to gui/wxpython/tools/update_menudata.py

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
"""!
 
1
"""
2
2
@brief Support script for wxGUI - only for developers needs. Updates
3
3
menudata.xml file.
4
4
 
30
30
from grass.script import core as grass
31
31
from grass.script import task as gtask
32
32
 
33
 
if __name__ == "__main__":
34
 
    sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'wxpython'))
35
 
from lmgr.menudata  import ManagerData
 
33
from lmgr.menudata  import LayerManagerMenuData
36
34
from core.globalvar import grassCmd
37
35
 
38
36
def parseModules():
39
 
    """!Parse modules' interface"""
 
37
    """Parse modules' interface"""
40
38
    modules = dict()
41
39
    
42
40
    # list of modules to be ignored
55
53
            continue
56
54
        try:
57
55
            interface = gtask.parse_interface(module)
58
 
        except Exception, e:
 
56
        except Exception as e:
59
57
            grass.error(module + ': ' + str(e))
60
58
            continue
61
59
        modules[interface.name] = { 'label'   : interface.label,
65
63
    return modules
66
64
 
67
65
def updateData(data, modules):
68
 
    """!Update menu data tree"""
 
66
    """Update menu data tree"""
69
67
    # list of modules to be ignored
70
68
    ignore = ['v.type_wrapper.py',
71
69
              'vcolors']
112
110
            grass.warning("'%s' not available from the menu" % module)
113
111
    
114
112
def writeData(data, file = None):
115
 
    """!Write updated menudata.xml"""
 
113
    """Write updated menudata.xml"""
116
114
    if file is None:
117
115
        file = os.path.join('xml', 'menudata.xml')
118
116
    
151
149
    modules = dict()
152
150
    modules = parseModules()
153
151
    grass.info("Step 3: reading menu data...")
154
 
    data = ManagerData()
 
152
    data = LayerManagerMenuData()
155
153
    grass.info("Step 4: updating menu data...")
156
154
    updateData(data, modules)
157
155