本文整理汇总了Python中umit.icm.agent.logger.g_logger.debug函数的典型用法代码示例。如果您正苦于以下问题:Python debug函数的具体用法?Python debug怎么用?Python debug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了debug函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: send_report
def send_report(self, report):
if isinstance(report, WebsiteReport):
self.send_website_report(report)
elif isinstance(report, ServiceReport):
self.send_service_report(report)
else:
g_logger.debug("Unable to recognize the report type.")
示例2: _on_activated
def _on_activated(self,widget,row,col):
""""""
self.install_btn.set_sensitive(True)
#choice
selection = self.treeview.get_selection()
(model,iter) = selection.get_selected()
if iter == None:
return
else:
cur_version = self.store.get_value(iter,1)
#fill self.current_record
rs = g_db_helper.select("select * from updates where version = '%s'" % cur_version)
if len(rs) != 1:
g_logger.error("Record is ERROR in DB!!!! The window will be closed!!!")
self.destroy()
self.current_record = {}
self.current_record["version"] = rs[0][0]
self.current_record["news_date"] = rs[0][1]
self.current_record["software_name"] = rs[0][2]
self.current_record["description"] = rs[0][3]
self.current_record["download_url"] = rs[0][4]
self.current_record["is_update"] = rs[0][5]
self.current_record["check_code"] = rs[0][6]
self.statusbar.push(0,_("You have selected the %s version" % \
self.current_record["version"]))
self.details_textview.set_buffer(self._set_details_content(_(self.current_record["description"] + "\n" +
"download:"+self.current_record["download_url"] + "\n" +
"Designed by Umit!"
)))
self.details_textview.show_all()
g_logger.debug("Selected the item %s" % (self.current_record))
示例3: connect_to_peer
def connect_to_peer(self, peer_id):
if self.agent_is_banned(peer_id):
g_logger.info("Agent %s is banned." % peer_id)
if peer_id == theApp.peer_info.ID:
g_logger.error("Can't connect to self.")
if peer_id not in self.sessions:
peer_entry = None
if peer_id in self.super_peers:
peer_entry = self.super_peers[peer_id]
elif peer_id in self.normal_peers:
peer_entry = self.normal_peers[peer_id]
elif peer_id in self.mobile_peers:
peer_entry = self.mobile_peers[peer_id]
else:
g_logger.error("Peer id '%s' doesn't exist in all peer lists." %
peer_id)
return
if self.network_is_banned(peer_entry.IP):
g_logger.info("Agent %s is banned in network grounds (%s)." % \
(peer_id, peer_entry.IP))
return
reactor.connectTCP(peer_entry.IP, peer_entry.Port,
theApp.factory)
g_logger.debug("Connecting to %s:%d..." %
(peer_entry.IP, peer_entry.Port))
示例4: _normal_peer_connected
def _normal_peer_connected(self, peer_id, ip, port, ciphered_public_key=None,
network_id=0):
if self.agent_is_banned(peer_id) or self.network_is_banned(ip):
g_logger.info("Desktop agent %s is banned or is running from "
"a banned network %s" % (peer_id, ip))
if peer_id in self.normal_peers:
self.remove_normal_peer(peer_id)
return False
if peer_id in self.normal_peers and \
self.normal_peers[peer_id].status == 'Connected':
g_logger.warning("Peer %s already connected." % peer_id)
return False
if peer_id in self.normal_peers:
g_logger.debug("Peer id %s already exists in normal peer list." %
peer_id)
self.normal_peers[peer_id].status = 'Connected'
else:
peer_entry = PeerEntry()
peer_entry.Type = 2
peer_entry.ID = peer_id
peer_entry.IP = ip
peer_entry.Port = port
peer_entry.CipheredPublicKey = ciphered_public_key
peer_entry.status = 'Connected'
peer_entry.network_id = network_id
self.normal_peers[peer_entry.ID] = peer_entry
self.connected_peer_num = self.connected_peer_num + 1
return True
示例5: _send_auth_response_message
def _send_auth_response_message(self):
response_msg = AuthenticatePeerResponse()
response_msg.token = str(theApp.peer_info.ID)
response_msg.cipheredPublicKey.mod = str(theApp.key_manager.public_key.mod)
response_msg.cipheredPublicKey.exp = str(theApp.key_manager.public_key.exp)
g_logger.debug("Sending AuthenticatePeerResponse message:\n%s" % \
response_msg)
self._send_message(response_msg)
示例6: _handle_register
def _handle_register(self, result):
if result:
self.peer_info.ID = result['id']
self.peer_info.CipheredPublicKeyHash = result['hash']
self.peer_info.is_registered = True
g_logger.debug("Register to Aggregator: %s" % result['id'])
return result
示例7: _handle_check_software
def _handle_check_software(self,message):
if message == None:
return
g_logger.debug("Finish check the software update.")
self.progress_bar.set_value(100)
#self.progress_bar = gtk.ProgressBar(100)
#show the record
self._load_updates()
示例8: open
def open(self, timeout=3000):
"""Connect to the database"""
if not os.path.exists(self.db_path):
raise IOError("Cannot find database at '%s'." % self.db_path)
self.conn = sqlite3.connect(self.db_path, timeout)
if not self.conn:
raise IOError("Unable to open database '%s'." % self.db_path)
g_logger.debug("Database connected '%s'." % self.db_path)
self.is_open = True
self.cur = self.conn.cursor()
示例9: onerror
def onerror(func,path,exec_info):
"""
shutil.rmtree callback(Attention:The rmtree cannot remove the readonly files in windows)
"""
import stat
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
func(path)
else:
g_logger.debug("rm:path%s"%path) #ignore errors
示例10: connectionLost
def connectionLost(self, reason):
self.factory.connectionNum = self.factory.connectionNum - 1
g_logger.debug("Connection #%d closed." % self.factory.connectionNum)
if self._session is not None:
g_logger.debug("Session %s ended." % self.remote_id)
if self.remote_type == 1:
theApp.peer_manager._super_peer_disconnected(self.remote_id)
elif self.remote_type == 2:
theApp.peer_manager._normal_peer_disconnected(self.remote_id)
示例11: _send_auth_message
def _send_auth_message(self):
request_msg = AuthenticatePeer()
request_msg.agentID = str(theApp.peer_info.ID)
request_msg.agentType = theApp.peer_info.Type
request_msg.agentPort = theApp.listen_port
request_msg.cipheredPublicKey.mod = str(theApp.key_manager.public_key.mod)
request_msg.cipheredPublicKey.exp = str(theApp.key_manager.public_key.exp)
g_logger.debug("Sending AuthenticatePeer message:\n%s" % request_msg)
self._send_message(request_msg)
self._auth_sent = True
示例12: send_report
def send_report(self, report):
if isinstance(report, WebsiteReport):
self.pending_report_ids.append(report.header.reportID)
self.send_website_report(report)
elif isinstance(report, ServiceReport):
print report
self.pending_report_ids.append(report.header.reportID)
self.send_service_report(report)
else:
g_logger.debug("Unable to recognize the report type.")
示例13: _handle_get_task_response
def _handle_get_task_response(self,message):
if message in None:
return
print message
print message.header
print message.tests
g_logger.debug("We have got tasks from aggregator")
return message
示例14: time_to_run
def time_to_run(self, cur_time):
if (
cur_time.tm_min in self.RunTime.minute
and cur_time.tm_hour in self.RunTime.hour
and cur_time.tm_mday in self.RunTime.day
and cur_time.tm_mon in self.RunTime.month
and cur_time.tm_wday in self.RunTime.weekday
):
g_logger.debug("It's time to run '%s'" % self)
return True
else:
return False
示例15: _handle_get_events_response
def _handle_get_events_response(self, message):
if message is None:
return
#print message
#print message.events
g_logger.debug("We have got events from aggregator")
for event in message.events:
theApp.event_manager.add_event(event)
return message