Skip to content

Commit

Permalink
Merge pull request #28 from knownsec/dev
Browse files Browse the repository at this point in the history
fix:display format
  • Loading branch information
wh0am1i authored Feb 5, 2021
2 parents 826c97b + 53ddd06 commit e5a22b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

setup(
name='zoomeye',
version='2.0.4.0',
version='2.0.4.1',
description='Python library and command-line tool for ZoomEye (https://www.zoomeye.org/doc)',
long_description=README,
long_description_content_type='text/x-rst',
Expand Down
7 changes: 2 additions & 5 deletions zoomeye/plotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def show_pie_chart(stat):
:param stat: list, all data and label
"""

print()
if len(stat) > len(config.COLOR_TABLE):
raise ("max support 10 items")

Expand All @@ -64,7 +63,6 @@ def show_pie_chart(stat):
else:
print(ch)
count += 1
print()


def unicode_output():
Expand Down Expand Up @@ -128,7 +126,6 @@ def generate_histogram(values, labels=None, force_ascii=False):
:param force_ascii: bool, unicode or ascii output
return :None
"""
print()
# max length and bar width
matrix = get_matrix(values, 36, 1)

Expand Down Expand Up @@ -163,8 +160,8 @@ def generate_histogram(values, labels=None, force_ascii=False):
r = trim_zeros(row)
data.append("".join(chars[item] for item in r))
out.append(fmt.format(*data))
result = '\n'.join(out) + '\n'
print(result)
for item in out:
print(' ' + item)



Expand Down
14 changes: 7 additions & 7 deletions zoomeye/show.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def print_facets(facets, facet_data, total, figure):
return
# print facet data

print('-' * 30)
printf("ZoomEye total data:{}".format(total))
print(' ' + '-' * 40)
printf(" ZoomEye total data:{}".format(total), color='green')
for facet in facets.split(","):
names = []
counts = []
Expand Down Expand Up @@ -207,21 +207,21 @@ def print_stat(keys, stat_data, num, figure):
"""
if not stat_data:
return
print('-' * 30)
printf("current total data:{}".format(num), color='green')
print(' ' + '-' * 40)
printf(" current total data:{}".format(num), color='green')
for key in keys.split(','):
print('{:-^40}'.format(key + " data"))
print(' {:-^40}'.format(key + " data"))
# print title
if figure is None:
printf("{:<35}{:<20}".format(key, "count"), color="green")
printf(" {:<35}{:<20}".format(key, "count"), color="green")

# sort by the amount of each data
item = stat_data.get(key)
sorted_item = sorted(item.items(), key=lambda x: x[1], reverse=True)
# print result
if figure is None:
for name, count in sorted_item:
printf("{:<35}{:<20}".format(name, count))
printf(" {:<35}{:<20}".format(name, count))

names = []
counts = []
Expand Down

0 comments on commit e5a22b6

Please sign in to comment.