extensions.py 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. """!
  2. @package modules.extensions
  3. @brief GRASS Addons extensions management classes
  4. Classes:
  5. - extensions::InstallExtensionWindow
  6. - extensions::ExtensionTree
  7. - extensions::UninstallExtensionWindow
  8. - extensions::CheckListExtension
  9. (C) 2008-2012 by the GRASS Development Team
  10. This program is free software under the GNU General Public License
  11. (>=v2). Read the file COPYING that comes with GRASS for details.
  12. @author Martin Landa <landa.martin gmail.com>
  13. """
  14. import os
  15. import sys
  16. import wx
  17. try:
  18. import wx.lib.agw.customtreectrl as CT
  19. except ImportError:
  20. import wx.lib.customtreectrl as CT
  21. import wx.lib.flatnotebook as FN
  22. import grass.script as grass
  23. from grass.script import task as gtask
  24. from core import globalvar
  25. from core.gcmd import GError, RunCommand
  26. from core.utils import SetAddOnPath
  27. from core.events import EVT_SHOW_NOTIFICATION
  28. from gui_core.forms import GUI
  29. from gui_core.widgets import ItemTree, GListCtrl, SearchModuleWidget, EVT_MODULE_SELECTED
  30. class ExtensionModulesData(object):
  31. """!Holds information about modules.
  32. @todo add some test
  33. @todo this class has some common methods with core::modulesdata::ModulesData
  34. """
  35. def __init__(self, modulesDesc):
  36. self.moduleDesc = modulesDesc
  37. self.moduleDescOriginal = modulesDesc
  38. def GetCommandDesc(self, cmd):
  39. """!Gets the description for a given module (command).
  40. If the given module is not available, an empty string is returned.
  41. \code
  42. print data.GetCommandDesc('r.info')
  43. Outputs basic information about a raster map.
  44. \endcode
  45. """
  46. if cmd in self.moduleDesc:
  47. return self.moduleDesc[cmd]['description']
  48. return ''
  49. def GetCommandItems(self):
  50. """!Gets list of available modules (commands).
  51. The list contains available module names.
  52. \code
  53. print data.GetCommandItems()[0:4]
  54. ['d.barscale', 'd.colorlist', 'd.colortable', 'd.correlate']
  55. \endcode
  56. """
  57. items = self.moduleDesc.keys()
  58. items.sort()
  59. return items
  60. def FindModules(self, text, findIn):
  61. """!Finds modules according to given text.
  62. @param text string to search
  63. @param findIn where to search for text
  64. (allowed values are 'description', 'keywords' and 'command')
  65. """
  66. modules = dict()
  67. iFound = 0
  68. for module, data in self.moduleDescOriginal.iteritems():
  69. found = False
  70. if findIn == 'description':
  71. if text in data['description']:
  72. found = True
  73. elif findIn == 'keywords':
  74. if text in data['keywords']:
  75. found = True
  76. elif findIn == 'command':
  77. if module[:len(text)] == text:
  78. found = True
  79. else:
  80. raise ValueError("Parameter findIn is not valid")
  81. if found:
  82. iFound += 1
  83. modules[module] = data
  84. return modules, iFound
  85. def SetFilter(self, data = None):
  86. """!Sets filter modules
  87. If @p data is not specified, module dictionary is derived
  88. from an internal data structures.
  89. @todo Document this method.
  90. @param data data dict
  91. """
  92. if data:
  93. self.moduleDesc = data
  94. else:
  95. self.moduleDesc = self.moduleDescOriginal
  96. def SetData(self, data):
  97. self.moduleDesc = self.moduleDescOriginal = data
  98. class InstallExtensionWindow(wx.Frame):
  99. def __init__(self, parent, id = wx.ID_ANY,
  100. title = _("Fetch & install extension from GRASS Addons"), **kwargs):
  101. self.parent = parent
  102. self.options = dict() # list of options
  103. wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
  104. self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
  105. self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
  106. self.repoBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
  107. label = " %s " % _("Repository"))
  108. self.treeBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
  109. label = " %s " % _("List of extensions"))
  110. self.repo = wx.TextCtrl(parent = self.panel, id = wx.ID_ANY)
  111. self.fullDesc = wx.CheckBox(parent = self.panel, id = wx.ID_ANY,
  112. label = _("Fetch full info including description and keywords"))
  113. self.fullDesc.SetValue(True)
  114. self.tree = ExtensionTree(parent = self.panel, log = parent.GetLogWindow())
  115. self.modulesData = ExtensionModulesData(modulesDesc = self.tree.GetModules())
  116. self.search = SearchModuleWidget(parent = self.panel, modulesData = self.modulesData,
  117. showChoice = False)
  118. self.search.SetSelection(0)
  119. self.search.Bind(EVT_MODULE_SELECTED, self.OnShowItem)
  120. self.optionBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
  121. label = " %s " % _("Options"))
  122. if sys.platform == 'win32':
  123. task = gtask.parse_interface('g.extension.py')
  124. else:
  125. task = gtask.parse_interface('g.extension')
  126. ignoreFlags = ['l', 'c', 'g', 'a', 'f', 't', 'quiet']
  127. if sys.platform == 'win32':
  128. ignoreFlags.append('d')
  129. ignoreFlags.append('i')
  130. for f in task.get_options()['flags']:
  131. name = f.get('name', '')
  132. desc = f.get('label', '')
  133. if not desc:
  134. desc = f.get('description', '')
  135. if not name and not desc:
  136. continue
  137. if name in ignoreFlags:
  138. continue
  139. self.options[name] = wx.CheckBox(parent = self.panel, id = wx.ID_ANY,
  140. label = desc)
  141. self.repo.SetValue(task.get_param(value = 'svnurl').get('default',
  142. 'http://svn.osgeo.org/grass/grass-addons/grass7'))
  143. self.statusbar = self.CreateStatusBar(number = 1)
  144. self.btnFetch = wx.Button(parent = self.panel, id = wx.ID_ANY,
  145. label = _("&Fetch"))
  146. self.btnFetch.SetToolTipString(_("Fetch list of available modules from GRASS Addons SVN repository"))
  147. self.btnClose = wx.Button(parent = self.panel, id = wx.ID_CLOSE)
  148. self.btnInstall = wx.Button(parent = self.panel, id = wx.ID_ANY,
  149. label = _("&Install"))
  150. self.btnInstall.SetToolTipString(_("Install selected add-ons GRASS module"))
  151. self.btnInstall.Enable(False)
  152. self.btnCmd = wx.Button(parent = self.panel, id = wx.ID_ANY,
  153. label = _("Command dialog"))
  154. self.btnCmd.SetToolTipString(_('Open %s dialog') % 'g.extension')
  155. self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
  156. self.btnFetch.Bind(wx.EVT_BUTTON, self.OnFetch)
  157. self.btnInstall.Bind(wx.EVT_BUTTON, self.OnInstall)
  158. self.btnCmd.Bind(wx.EVT_BUTTON, self.OnCmdDialog)
  159. self.tree.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnItemActivated)
  160. self.tree.Bind(wx.EVT_TREE_SEL_CHANGED, self.OnItemSelected)
  161. self.search.Bind(wx.EVT_TEXT_ENTER, self.OnShowItem)
  162. self.search.Bind(wx.EVT_TEXT, self.OnUpdateStatusBar)
  163. # show text in statusbar when notification command event occurs
  164. # propagation stops here, no need to show text twice
  165. self.Bind(EVT_SHOW_NOTIFICATION,
  166. lambda event: self.SetStatusText(event.message))
  167. self._layout()
  168. def _layout(self):
  169. """!Do layout"""
  170. sizer = wx.BoxSizer(wx.VERTICAL)
  171. repoSizer = wx.StaticBoxSizer(self.repoBox, wx.VERTICAL)
  172. repo1Sizer = wx.BoxSizer(wx.HORIZONTAL)
  173. repo1Sizer.Add(item = self.repo, proportion = 1,
  174. flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL, border = 1)
  175. repo1Sizer.Add(item = self.btnFetch, proportion = 0,
  176. flag = wx.ALL | wx.ALIGN_CENTER_VERTICAL, border = 1)
  177. repoSizer.Add(item = repo1Sizer,
  178. flag = wx.EXPAND)
  179. repoSizer.Add(item = self.fullDesc)
  180. findSizer = wx.BoxSizer(wx.HORIZONTAL)
  181. findSizer.Add(item = self.search, proportion = 1)
  182. treeSizer = wx.StaticBoxSizer(self.treeBox, wx.HORIZONTAL)
  183. treeSizer.Add(item = self.tree, proportion = 1,
  184. flag = wx.ALL | wx.EXPAND, border = 1)
  185. # options
  186. optionSizer = wx.StaticBoxSizer(self.optionBox, wx.VERTICAL)
  187. for key in self.options.keys():
  188. optionSizer.Add(item = self.options[key], proportion = 0)
  189. btnSizer = wx.BoxSizer(wx.HORIZONTAL)
  190. btnSizer.Add(item = self.btnCmd, proportion = 0,
  191. flag = wx.RIGHT, border = 5)
  192. btnSizer.AddSpacer(10)
  193. btnSizer.Add(item = self.btnClose, proportion = 0,
  194. flag = wx.RIGHT, border = 5)
  195. btnSizer.Add(item = self.btnInstall, proportion = 0)
  196. sizer.Add(item = repoSizer, proportion = 0,
  197. flag = wx.ALL | wx.EXPAND, border = 3)
  198. sizer.Add(item = findSizer, proportion = 0,
  199. flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)
  200. sizer.Add(item = treeSizer, proportion = 1,
  201. flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)
  202. sizer.Add(item = optionSizer, proportion = 0,
  203. flag = wx.LEFT | wx.RIGHT | wx.BOTTOM | wx.EXPAND, border = 3)
  204. sizer.Add(item = btnSizer, proportion = 0,
  205. flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
  206. self.panel.SetSizer(sizer)
  207. sizer.Fit(self.panel)
  208. self.Layout()
  209. def _getCmd(self):
  210. item = self.tree.GetSelected()
  211. if not item or not item.IsOk():
  212. return ['g.extension']
  213. name = self.tree.GetItemText(item)
  214. if not name:
  215. GError(_("Extension not defined"), parent = self)
  216. return
  217. flags = list()
  218. for key in self.options.keys():
  219. if self.options[key].IsChecked():
  220. if len(key) == 1:
  221. flags.append('-%s' % key)
  222. else:
  223. flags.append('--%s' % key)
  224. return ['g.extension'] + flags + ['extension=' + name,
  225. 'svnurl=' + self.repo.GetValue().strip()]
  226. def OnUpdateStatusBar(self, event):
  227. """!Update statusbar text"""
  228. element = self.search.GetSelection()
  229. if not self.tree.IsLoaded():
  230. self.SetStatusText(_("Fetch list of available extensions by clicking on 'Fetch' button"), 0)
  231. return
  232. self.tree.SearchItems(element = element,
  233. value = event.GetEventObject().GetValue())
  234. nItems = len(self.tree.itemsMarked)
  235. if event.GetString():
  236. self.SetStatusText(_("%d items match") % nItems, 0)
  237. else:
  238. self.SetStatusText("", 0)
  239. event.Skip()
  240. def OnCloseWindow(self, event):
  241. """!Close window"""
  242. self.Destroy()
  243. def OnFetch(self, event):
  244. """!Fetch list of available extensions"""
  245. wx.BeginBusyCursor()
  246. self.SetStatusText(_("Fetching list of modules from GRASS-Addons SVN (be patient)..."), 0)
  247. self.tree.Load(url = self.repo.GetValue().strip(), full = self.fullDesc.IsChecked())
  248. modulesDesc = self.tree.GetModules()
  249. self.modulesData.SetData(modulesDesc)
  250. self.SetStatusText("", 0)
  251. wx.EndBusyCursor()
  252. def OnItemActivated(self, event):
  253. item = event.GetItem()
  254. data = self.tree.GetPyData(item)
  255. if data and 'command' in data:
  256. self.OnInstall(event = None)
  257. def OnInstall(self, event):
  258. """!Install selected extension"""
  259. log = self.parent.GetLogWindow()
  260. log.RunCmd(self._getCmd(), onDone = self.OnDone)
  261. def OnDone(self, cmd, returncode):
  262. if returncode == 0:
  263. if not os.getenv('GRASS_ADDON_BASE'):
  264. SetAddOnPath(key = 'BASE')
  265. globalvar.UpdateGRASSAddOnCommands()
  266. def OnItemSelected(self, event):
  267. """!Item selected"""
  268. item = event.GetItem()
  269. self.tree.itemSelected = item
  270. data = self.tree.GetPyData(item)
  271. if data is None:
  272. self.SetStatusText('', 0)
  273. self.btnInstall.Enable(False)
  274. else:
  275. self.SetStatusText(data.get('description', ''), 0)
  276. self.btnInstall.Enable(True)
  277. def OnShowItem(self, event):
  278. """!Show selected item"""
  279. self.tree.OnShowItem(event)
  280. if self.tree.GetSelected():
  281. self.btnInstall.Enable()
  282. else:
  283. self.btnInstall.Enable(False)
  284. def OnCmdDialog(self, event):
  285. """!Shows command dialog"""
  286. GUI(parent = self).ParseCommand(cmd = self._getCmd())
  287. class ExtensionTree(ItemTree):
  288. """!List of available extensions"""
  289. def __init__(self, parent, log, id = wx.ID_ANY,
  290. ctstyle = CT.TR_HIDE_ROOT | CT.TR_FULL_ROW_HIGHLIGHT | CT.TR_HAS_BUTTONS |
  291. CT.TR_LINES_AT_ROOT | CT.TR_SINGLE,
  292. **kwargs):
  293. self.parent = parent # GMFrame
  294. self.log = log
  295. super(ExtensionTree, self).__init__(parent, id, ctstyle = ctstyle, **kwargs)
  296. self._initTree()
  297. def _initTree(self):
  298. for prefix in ('display', 'database',
  299. 'general', 'imagery',
  300. 'misc', 'postscript', 'paint',
  301. 'raster', 'raster3D', 'sites', 'vector', 'wxGUI', 'other'):
  302. self.AppendItem(parentId = self.root,
  303. text = prefix)
  304. self._loaded = False
  305. def _expandPrefix(self, c):
  306. name = { 'd' : 'display',
  307. 'db' : 'database',
  308. 'g' : 'general',
  309. 'i' : 'imagery',
  310. 'm' : 'misc',
  311. 'ps' : 'postscript',
  312. 'p' : 'paint',
  313. 'r' : 'raster',
  314. 'r3' : 'raster3D',
  315. 's' : 'sites',
  316. 'v' : 'vector',
  317. 'wx' : 'wxGUI',
  318. '' : 'other' }
  319. if c in name:
  320. return name[c]
  321. return c
  322. def _findItem(self, text):
  323. """!Find item"""
  324. item = self.GetFirstChild(self.root)[0]
  325. while item and item.IsOk():
  326. if text == self.GetItemText(item):
  327. return item
  328. item = self.GetNextSibling(item)
  329. return None
  330. def Load(self, url, full = False):
  331. """!Load list of extensions"""
  332. self.DeleteAllItems()
  333. self.root = self.AddRoot(_("Menu tree"))
  334. self._initTree()
  335. if full:
  336. flags = 'g'
  337. else:
  338. flags = 'l'
  339. ret = RunCommand('g.extension', read = True, parent = self,
  340. svnurl = url,
  341. flags = flags, quiet = True)
  342. if not ret:
  343. return
  344. mdict = dict()
  345. for line in ret.splitlines():
  346. if full:
  347. try:
  348. key, value = line.split('=', 1)
  349. except ValueError:
  350. key = 'name'
  351. value = line
  352. if key == 'name':
  353. try:
  354. prefix, name = value.split('.', 1)
  355. except ValueError:
  356. prefix = ''
  357. name = value
  358. if prefix not in mdict:
  359. mdict[prefix] = dict()
  360. mdict[prefix][name] = dict()
  361. else:
  362. mdict[prefix][name][key] = value
  363. else:
  364. try:
  365. prefix, name = line.strip().split('.', 1)
  366. except:
  367. prefix = ''
  368. name = line.strip()
  369. if self._expandPrefix(prefix) == prefix:
  370. prefix = ''
  371. if prefix not in mdict:
  372. mdict[prefix] = dict()
  373. mdict[prefix][name] = { 'command' : prefix + '.' + name }
  374. for prefix in mdict.keys():
  375. prefixName = self._expandPrefix(prefix)
  376. item = self._findItem(prefixName)
  377. names = mdict[prefix].keys()
  378. names.sort()
  379. for name in names:
  380. if prefix:
  381. text = prefix + '.' + name
  382. else:
  383. text = name
  384. new = self.AppendItem(parentId = item,
  385. text = text)
  386. data = dict()
  387. for key in mdict[prefix][name].keys():
  388. data[key] = mdict[prefix][name][key]
  389. self.SetPyData(new, data)
  390. self._loaded = True
  391. def IsLoaded(self):
  392. """Check if items are loaded"""
  393. return self._loaded
  394. def GetModules(self):
  395. modules = {}
  396. root = self.GetRootItem()
  397. child, cookie = self.GetFirstChild(root)
  398. while child and child.IsOk():
  399. if self.ItemHasChildren(child):
  400. subChild, subCookie = self.GetFirstChild(child)
  401. while subChild and subChild.IsOk():
  402. name = self.GetItemText(subChild)
  403. data = self.GetPyData(subChild)
  404. modules[name] = data
  405. subChild, subCookie = self.GetNextChild(child, subCookie)
  406. child, cookie = self.GetNextChild(root, cookie)
  407. return modules
  408. class UninstallExtensionWindow(wx.Frame):
  409. def __init__(self, parent, id = wx.ID_ANY,
  410. title = _("Uninstall GRASS Addons extensions"), **kwargs):
  411. self.parent = parent
  412. wx.Frame.__init__(self, parent = parent, id = id, title = title, **kwargs)
  413. self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
  414. self.panel = wx.Panel(parent = self, id = wx.ID_ANY)
  415. self.extBox = wx.StaticBox(parent = self.panel, id = wx.ID_ANY,
  416. label = " %s " % _("List of installed extensions"))
  417. self.extList = CheckListExtension(parent = self.panel)
  418. # buttons
  419. self.btnUninstall = wx.Button(parent = self.panel, id = wx.ID_ANY,
  420. label = _("&Uninstall"))
  421. self.btnUninstall.SetToolTipString(_("Uninstall selected AddOns extensions"))
  422. self.btnCmd = wx.Button(parent = self.panel, id = wx.ID_ANY,
  423. label = _("Command dialog"))
  424. self.btnCmd.SetToolTipString(_('Open %s dialog') % 'g.extension')
  425. self.btnClose = wx.Button(parent = self.panel, id = wx.ID_CLOSE)
  426. self.btnUninstall.Bind(wx.EVT_BUTTON, self.OnUninstall)
  427. self.btnCmd.Bind(wx.EVT_BUTTON, self.OnCmdDialog)
  428. self.btnClose.Bind(wx.EVT_BUTTON, self.OnCloseWindow)
  429. self._layout()
  430. def _layout(self):
  431. """!Do layout"""
  432. sizer = wx.BoxSizer(wx.VERTICAL)
  433. extSizer = wx.StaticBoxSizer(self.extBox, wx.HORIZONTAL)
  434. extSizer.Add(item = self.extList, proportion = 1,
  435. flag = wx.ALL | wx.EXPAND, border = 1)
  436. btnSizer = wx.BoxSizer(wx.HORIZONTAL)
  437. btnSizer.Add(item = self.btnCmd, proportion = 0,
  438. flag = wx.RIGHT, border = 5)
  439. btnSizer.AddSpacer(10)
  440. btnSizer.Add(item = self.btnClose, proportion = 0,
  441. flag = wx.RIGHT, border = 5)
  442. btnSizer.Add(item = self.btnUninstall, proportion = 0)
  443. sizer.Add(item = extSizer, proportion = 1,
  444. flag = wx.ALL | wx.EXPAND, border = 3)
  445. sizer.Add(item = btnSizer, proportion = 0,
  446. flag = wx.ALIGN_RIGHT | wx.ALL, border = 5)
  447. self.panel.SetSizer(sizer)
  448. sizer.Fit(self.panel)
  449. self.Layout()
  450. def OnCloseWindow(self, event):
  451. """!Close window"""
  452. self.Destroy()
  453. def OnUninstall(self, event):
  454. """!Uninstall selected extensions"""
  455. log = self.parent.GetLogWindow()
  456. eList = self.extList.GetExtensions()
  457. if not eList:
  458. GError(_("No extension selected for removal. "
  459. "Operation canceled."),
  460. parent = self)
  461. return
  462. for ext in eList:
  463. files = RunCommand('g.extension', parent = self, read = True, quiet = True,
  464. extension = ext, operation = 'remove').splitlines()
  465. dlg = wx.MessageDialog(parent = self,
  466. message = _("List of files to be removed:\n%(files)s\n\n"
  467. "Do you want really to remove <%(ext)s> extension?") % \
  468. { 'files' : os.linesep.join(files), 'ext' : ext },
  469. caption = _("Remove extension"),
  470. style = wx.YES_NO | wx.NO_DEFAULT | wx.ICON_QUESTION)
  471. if dlg.ShowModal() == wx.ID_YES:
  472. RunCommand('g.extension', flags = 'f', parent = self, quiet = True,
  473. extension = ext, operation = 'remove')
  474. self.extList.LoadData()
  475. # update prompt
  476. globalvar.UpdateGRASSAddOnCommands(eList)
  477. log = self.parent.GetLogWindow()
  478. log.GetPrompt().SetFilter(None)
  479. def OnCmdDialog(self, event):
  480. """!Shows command dialog"""
  481. GUI(parent = self).ParseCommand(cmd = ['g.extension'])
  482. class CheckListExtension(GListCtrl):
  483. """!List of mapset/owner/group"""
  484. def __init__(self, parent):
  485. GListCtrl.__init__(self, parent)
  486. # load extensions
  487. self.InsertColumn(0, _('Extension'))
  488. self.LoadData()
  489. def LoadData(self):
  490. """!Load data into list"""
  491. self.DeleteAllItems()
  492. for ext in RunCommand('g.extension',
  493. quiet = True, parent = self, read = True,
  494. flags = 'a').splitlines():
  495. if ext:
  496. self.InsertStringItem(sys.maxint, ext)
  497. def GetExtensions(self):
  498. """!Get extensions to be un-installed
  499. """
  500. extList = list()
  501. for i in range(self.GetItemCount()):
  502. if self.IsChecked(i):
  503. name = self.GetItemText(i)
  504. if name:
  505. extList.append(name)
  506. return extList