import datetime import gtk class BaseStationInformation: def __init__ (self): self.country = 'Nowhere' self.provider = 'Carry' self.arfcn = 0 self.rxlev = 0 self.system_info_t2 = [] self.discovery_time = datetime.datetime.now().strftime('%T') def get_list_model(self): return (self.provider, self.arfcn, self.rxlev, self.discovery_time) def get_neighbour_arfcn(self): #5-19 neighbours = self.system_info_t2[6:21] pass class BaseStationInformationList: def __init__(self): self._base_station_list = [] def add_station(self, base_station): for item in self._base_station_list: if item.arfcn == base_station.arfcn: item.discovery_time = datetime.datetime.now().strftime('%T') break else: self._base_station_list.append(base_station) base_station.get_neighbour_arfcn() def get_dot_code(self): preamble = r'digraph bsnetwork{ ' postamble = r'}' code = '' for item in self._base_station_list: code += item.arfcn + r'; ' return preamble + code + postamble def refill_store(self, store): store.clear() for item in self._base_station_list: store.append(item.get_list_model())