當前位置: 首頁>>代碼示例>>Python>>正文


Python MainWindow.update_sources_table方法代碼示例

本文整理匯總了Python中gui.MainWindow.update_sources_table方法的典型用法代碼示例。如果您正苦於以下問題:Python MainWindow.update_sources_table方法的具體用法?Python MainWindow.update_sources_table怎麽用?Python MainWindow.update_sources_table使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在gui.MainWindow的用法示例。


在下文中一共展示了MainWindow.update_sources_table方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_gui_main_window

# 需要導入模塊: from gui import MainWindow [as 別名]
# 或者: from gui.MainWindow import update_sources_table [as 別名]
	def test_gui_main_window(self):
		from gi.repository import Gtk
		try:
			from .config import Config
			from .map import Map
			from .gui import MainWindow
		except SystemError:
			from config import Config
			from map import Map
			from gui import MainWindow
		def dummy():
			return
		
		test_config = Config(None).default_config
		test_map = Map(test_config["map"])
		test_networks =  networks()
		
		main_window = MainWindow(test_config, dummy, dummy, test_map, test_networks, None, None)
		main_window.network_list.crypt_cache = {}
		
		main_window.log_list.add("test")
		main_window.network_list.network_selected = "11:22:33:44:55:66"
		main_window.network_list.add_network('00:12:2A:03:B9:12')
		main_window.network_list.add_network('00:12:2A:03:B9:12')
		main_window.network_list.remove_network('00:12:2A:03:B9:12')
		main_window.update_info_table({"networks":100, "packets":200})
		main_window.update_gps_table({"fix": 3, "lat": 52.0, "lon": 13.0})
		sources = {"1": {"uuid": "1", "username": "test", "type": "bla",
			"channel": 11, "packets": 100}}
		main_window.update_sources_table(sources)
		main_window.on_configure_event(None, None)
		main_window.on_config_window(None)
		main_window.on_config_window(None)
		main_window.on_signal_graph(None)
		main_window.on_signal_graph_destroy(None, "11:22:33:44:55:66")
		main_window.fullscreen()
		main_window.fullscreen()
		main_window.on_map_window(None, True)
		main_window.on_map_window(None, False)
		main_window.on_map_widget(None, True)
		main_window.on_map_widget(None, False)
		main_window.on_client_disconnect(None)
		test_event = TestEvent()
		main_window.on_window_state(None, test_event)
		
		test_widget = TestWidget()
		config_window = main_window.config_window
		
		main_window.on_file_import(None)
		
		test_widget.text = "Infrastructure"
		main_window.on_network_filter_type(test_widget)
		main_window.on_network_filter_networks(test_widget, "map", "all")
開發者ID:vaginessa,項目名稱:kismon,代碼行數:55,代碼來源:test.py

示例2: __init__

# 需要導入模塊: from gui import MainWindow [as 別名]
# 或者: from gui.MainWindow import update_sources_table [as 別名]

#.........這裏部分代碼省略.........
					gps = data
				if data["fix"] > 1:
					fix = (data["lat"], data["lon"])
					break
			except IndexError:
				break
		if gps is not None:
			self.main_window.update_gps_table(gps)
			if fix is not None and self.map is not None:
				self.map.set_position(fix[0], fix[1])
		
		#status
		for data in self.client_thread.get_queue("status"):
			self.main_window.log_list.add(data["text"])
		
		#info
		info_queue = self.client_thread.get_queue("info")
		try:
			data = info_queue.pop()
			self.main_window.update_info_table(data)
		except IndexError:
			pass
			
		#source
		update = False
		for data in self.client_thread.get_queue("source"):
			uuid = data["uuid"]
			if uuid == "00000000-0000-0000-0000-000000000000":
				continue
			self.sources[uuid] = data
			
			update = True
		if update is True:
			self.main_window.update_sources_table(self.sources)
		
		return True
		
	def queue_handler_networks(self):
		#ssid
		for data in self.client_thread.get_queue("ssid"):
			self.networks.add_ssid_data(data)
		
		#bssid
		bssids = {}
		for data in self.client_thread.get_queue("bssid"):
			mac = data["bssid"]
			self.networks.add_bssid_data(data)
			if mac in self.main_window.signal_graphs and "signal_dbm" not in self.client_thread.client.capabilities["bssidsrc"]:
				self.main_window.signal_graphs[mac].add_value(None, None, data["signal_dbm"])
			
			bssids[mac] = True
			
		#bssidsrc
		for data in self.client_thread.get_queue("bssidsrc"):
			if "signal_dbm" not in data or data["uuid"] not in self.sources:
				continue
			
			mac = data["bssid"]
			if mac in self.main_window.signal_graphs:
				self.main_window.signal_graphs[mac].add_value(self.sources[data["uuid"]], data, data["signal_dbm"])
		
		if len(self.networks.notify_add_queue) > 0:
			self.networks.start_queue()
			if len(self.networks.notify_add_queue) > 500:
				self.networks.disable_refresh()
				self.main_window.networks_queue_progress()
開發者ID:vaginessa,項目名稱:kismon,代碼行數:70,代碼來源:core.py


注:本文中的gui.MainWindow.update_sources_table方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。