本文整理汇总了Python中animation.Animation.double_hashtag_bar方法的典型用法代码示例。如果您正苦于以下问题:Python Animation.double_hashtag_bar方法的具体用法?Python Animation.double_hashtag_bar怎么用?Python Animation.double_hashtag_bar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类animation.Animation
的用法示例。
在下文中一共展示了Animation.double_hashtag_bar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Master
# 需要导入模块: from animation import Animation [as 别名]
# 或者: from animation.Animation import double_hashtag_bar [as 别名]
#.........这里部分代码省略.........
self.write_to_log('\t>> Setup phase...')
self.s.sendto('setup', (self.setup_tool.get_client_ip_ctrl(), CLIENTPORT))
self.s.sendto('setup', (self.setup_tool.get_server_ip_ctrl(), SERVERPORT))
server_status = False
client_status = False
self.num_of_records = self.setup_tool.parse_unity(scenario)
if self.setup_tool.get_software() == 'bind' or self.setup_tool.get_software() == 'nsd':
print '\nquery files\t\t|\tzone files'
elif self.setup_tool.get_software() == 'pdns' or self.setup_tool.get_software() == 'mydns':
print '\nquery files\t\t|\tMySQL'
try:
while 1:
buf, addr = self.s.recvfrom(4096)
if buf == 'server 100 OK':
self.send_server_setup()
elif buf == 'client 100 OK':
self.send_client_setup()
elif buf == 'server 400 Bad Request':
self.write_to_log('>> Message to server was corrupted. Sending again...')
self.send_server_setup()
elif buf == 'client 400 Bad Request':
self.write_to_log('>> Message to client was corrupted. Sending again...')
self.send_client_setup()
elif buf == 'server 200 OK':
server_status = True
elif buf == 'client 200 OK':
client_status = True
elif buf.startswith('q'):
self.anime.double_hashtag_bar(int(buf.split(';')[1]), 1)
elif buf.startswith('z'):
self.anime.double_hashtag_bar(int(buf.split(';')[1]), 2)
else:
if buf.find('ERROR') >= 0:
self.parse_error(buf)
if server_status and client_status:
break
except KeyboardInterrupt:
self.write_to_log('>> Ctrl+c pressed! Exiting...\n')
print '\t>> Exiting...'
exit()
self.write_to_log('done!\n')
#------------------------------------------------------------------------------
def send_server_setup (self):
""" Get data of scenario related to Server """
default = str(self.setup_tool.get_software() + ';' + self.setup_tool.get_processes() + ';' +
self.setup_tool.get_processes_users() + ';' + str(self.num_of_records) + ';' +
str(self.setup_tool.get_num_of_zones()) + ';' + self.setup_tool.get_domain_name() + ';' +
self.setup_tool.get_server_ip_qry() + ';' + str(self.setup_tool.get_num_of_naptr()) + ';' +
self.setup_tool.get_limit() + ';' + str(self.setup_tool.get_num_of_cpu()) + ';' +
str(self.setup_tool.update_enabled()) + ';' + str(self.setup_tool.get_update_rate()) + ';')
if self.setup_tool.get_software() == 'bind' or self.setup_tool.get_software() == 'nsd':
software_specifics = str(self.setup_tool.get_server_pass() + ';' + self.setup_tool.get_create_zones() + ';' +
self.setup_tool.get_restart_software())
elif self.setup_tool.get_software() == 'pdns' or self.setup_tool.get_software() == 'mydns':
software_specifics = str(self.setup_tool.get_mysql_database() + ';' + self.setup_tool.get_mysql_user() + ';' +
self.setup_tool.get_mysql_user_pass() + ';' + self.setup_tool.get_create_database())