def get_available_screen_for_user_agent():
""" Get the available length for the user agent """
column_padding = 18
avail_length = 0
for c in Client.query.all():
columns_length = len(str(c.id)) + len(str(c.client_id)) + len(str(c.last_beaconed)) + len(str(c.ip))
current_avail_length = shutil.get_terminal_size().columns - columns_length - column_padding
avail_length = max(avail_length, current_avail_length)
return avail_length
评论列表
文章目录