本文整理汇总了Python中higwidgets.higbuttons.HIGButton.get_children方法的典型用法代码示例。如果您正苦于以下问题:Python HIGButton.get_children方法的具体用法?Python HIGButton.get_children怎么用?Python HIGButton.get_children使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类higwidgets.higbuttons.HIGButton
的用法示例。
在下文中一共展示了HIGButton.get_children方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: HostDiscovery
# 需要导入模块: from higwidgets.higbuttons import HIGButton [as 别名]
# 或者: from higwidgets.higbuttons.HIGButton import get_children [as 别名]
#.........这里部分代码省略.........
def _return_list(self, event):
"""
Return target list.
"""
hosts = [ ]
for row in self.target_model:
hosts.append(row[0])
self.results = ' '.join([str(h) for h in hosts])
if self.daddy: # NewInventory instance
self.daddy.scantarget.set_text(self.results)
self._exit(None)
def get_networks(self, event):
"""
Try to detect network(s).
"""
networks = tryto_detect_networks()
if not networks:
dlg = HIGAlertDialog(self,
message_format=_("No network(s) detected."),
secondary_text=_("You will need to especify the "
"network(s) yourself before detecting hosts."))
dlg.run()
dlg.destroy()
return
entries = len(self.networks_box.get_children()) - 1
for amount, nw in enumerate(networks):
if amount == entries:
e = gtk.Entry()
e.set_text('')
e.show()
self.networks_box.add(e)
entries += 1
entry = self.networks_box.get_children()[amount]
entry.set_text(nw.cidr_netaddress())
def get_addresses(self, event):
"""
Get hosts for network(s).
"""
networks = []
for entry in self.networks_box.get_children()[:-1]:
text_entry = entry.get_text()
wrong = alpha.search(text_entry)
if wrong:
self._error_invalid_network(text_entry)
return
elif text_entry:
networks.append(text_entry)
if not networks:
dlg = HIGAlertDialog(self, message_format=_("No network."),
secondary_text=_("You need to specify at least "
"one network to search for hosts."))