-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathg.gui.cswbrowser.py
executable file
·65 lines (48 loc) · 1.63 KB
/
g.gui.cswbrowser.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python3
"""
@module g.gui.cswbrowser
@brief GUI csw browser
(C) 2015 by the GRASS Development Team
This program is free software under the GNU General Public License
(>=v2). Read the file COPYING that comes with GRASS for details.
@author Matej Krejci <matejkrejci gmail.com> (GSoC 2015)
"""
# %module
# % description: Graphical CSW metadata browser.
# % keyword: general
# % keyword: GUI
# % keyword: metadata
# %end
import grass.script as gs
from grass.script.setup import set_gui_path
gs.utils.set_path(modulename="wx.metadata", dirname="mdlib", path="..")
from mdlib import globalvar
from mdlib.cswlib import CSWBrowserPanel, CSWConnectionPanel
import wx
set_gui_path()
class CswBrowserMainDialog(wx.Frame):
def __init__(self, giface=None):
wx.Frame.__init__(self, None, title="Metadata browser", size=(1024, 760))
self.mainNotebook = wx.Notebook(self, wx.ID_ANY)
self.config = wx.Config("g.gui.cswbrowser")
self.BrowserPanel = CSWBrowserPanel(self.mainNotebook, self, giface)
self.connectionPanel = CSWConnectionPanel(self.mainNotebook, self)
self.mainNotebook.AddPage(self.BrowserPanel, text="Find")
self.mainNotebook.AddPage(self.connectionPanel, text="Configure")
self._layout()
def _layout(self):
self.mainsizer = wx.BoxSizer(wx.VERTICAL)
self.mainsizer.Add(
self.mainNotebook,
1,
wx.EXPAND,
)
self.SetSizer(self.mainsizer)
def main(giface=None):
app = wx.App()
a = CswBrowserMainDialog(giface)
a.Show()
app.MainLoop()
if __name__ == "__main__":
gs.parser()
main()