本文整理汇总了Python中w3af.core.ui.console.tables.table函数的典型用法代码示例。如果您正苦于以下问题:Python table函数的具体用法?Python table怎么用?Python table使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了table函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show_progress_on_request
def show_progress_on_request(self):
"""
When the user hits enter, show the progress
"""
while self._w3af.status.is_running():
# Define some variables...
user_press_enter = False
# TODO: This if is terrible! I need to remove it!
# read from sys.stdin with a 0.5 second timeout
if sys.platform != "win32":
# linux
rfds, wfds, efds = select.select([sys.stdin], [], [], 0.5)
if rfds:
if len(sys.stdin.readline()):
user_press_enter = True
else:
# windows
import msvcrt
time.sleep(0.3)
if msvcrt.kbhit():
if term.read(1) in ["\n", "\r", "\r\n", "\n\r"]:
user_press_enter = True
# If something was written to sys.stdin, read it
if user_press_enter:
# Get the information and print it to the user
status_information_str = self._w3af.status.get_long_status()
t = table([(status_information_str,)])
t.draw()
om.out.console("")
示例2: run_read
def run_read(self):
api_result = self.api_read()
if not api_result["os"]:
return "Remote OS not identified."
else:
rows = []
rows.append(["Remote OS", api_result["os"]])
result_table = table(rows)
result_table.draw(80)
return rows
示例3: run_read
def run_read(self):
api_result = self.api_read()
rows = []
rows.append(['Description', 'Value'])
rows.append([])
for key in api_result:
rows.append([key, str(api_result[key])])
result_table = table(rows)
result_table.draw(80)
return rows
示例4: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return 'No MySQL configuration directories were found.'
else:
rows = [['MySQL configuration directory'], []]
for directory in api_result['directory']:
rows.append([directory, ])
result_table = table(rows)
result_table.draw(80)
return rows
示例5: run_read
def run_read(self, output_directory):
api_result = self.api_read(output_directory)
if not api_result:
return 'Failed to download the application source code.'
else:
rows = [['Remote file', 'Local file', ], []]
for url, (remote_filename, local_filename) in api_result.items():
rows.append([remote_filename, local_filename])
result_table = table(rows)
result_table.draw(140)
return rows
示例6: run_read
def run_read(self):
api_result = self.api_read()
if not api_result['kernel_version']:
return 'Failed to identify kernel version.'
else:
rows = []
rows.append(['Kernel version', ])
rows.append([])
rows.append([api_result['kernel_version'], ])
result_table = table(rows)
result_table.draw(80)
return rows
示例7: run_read
def run_read(self):
api_result = self.api_read()
if not api_result['apache_directory']:
return 'Apache configuration directory not found.'
else:
rows = [['Apache directories', ], []]
for key_name in api_result:
for path in api_result[key_name]:
rows.append([path, ])
result_table = table(rows)
result_table.draw(80)
return rows
示例8: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return 'MySQL configuration files not found.'
else:
rows = [['MySQL configuration file', 'Content'], []]
for filename in api_result:
rows.append([filename, api_result[filename]])
rows.append([])
result_table = table(rows[:-1])
result_table.draw(80)
return rows
示例9: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return "No MySQL configuration directories were found."
else:
rows = []
rows.append(["MySQL configuration directory"])
rows.append([])
for directory in api_result["directory"]:
rows.append([directory])
result_table = table(rows)
result_table.draw(80)
return rows
示例10: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return 'No user configuration files found.'
else:
rows = []
rows.append(['User configuration files', ])
rows.append([])
for filename in api_result:
rows.append([filename, ])
result_table = table(rows)
result_table.draw(80)
return rows
示例11: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return 'Domain name not found.'
else:
rows = []
rows.append(['Domain name', ])
rows.append([])
for domain in api_result.values():
rows.append([domain, ])
result_table = table(rows)
result_table.draw(80)
return rows
示例12: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return "No hashes were found."
else:
rows = []
rows.append(["User", "Hash"])
rows.append([])
for user, uhash in api_result.items():
rows.append([user, uhash])
result_table = table(rows)
result_table.draw(80)
return rows
示例13: run_read
def run_read(self):
api_result = self.api_read()
if not api_result['apache_config']:
return 'Apache configuration files not found.'
else:
rows = []
rows.append(['Apache configuration files'])
rows.append([])
for key_name in api_result:
for filename, file_content in api_result[key_name].items():
rows.append([filename, ])
result_table = table(rows)
result_table.draw(80)
return rows
示例14: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return 'No CPU information found.'
else:
rows = []
rows.append(['Description', 'Value'])
rows.append([])
for name in api_result:
rows.append([name, api_result[name]])
result_table = table(rows)
result_table.draw(80)
return rows
示例15: run_read
def run_read(self):
api_result = self.api_read()
if not api_result:
return 'No log files not found.'
else:
rows = []
rows.append(['Log files'])
rows.append([])
for filename in api_result:
rows.append([filename, ])
result_table = table(rows)
result_table.draw(80)
return rows