1010 DetectedIssuesResponse ,
1111 GroupListResponse ,
1212 GroupStatusResponse ,
13+ ProjectListResponse ,
1314 VersionResponse ,
1415)
1516
@@ -33,7 +34,7 @@ def format_analysis_list(resp: AnalysisListResponse) -> str:
3334 """Format an analysis list response to a simple text representation."""
3435
3536 res = []
36- for analysis in resp :
37+ for analysis in resp . analyses :
3738 res .append ("UUID: {}" .format (analysis .uuid ))
3839 res .append ("Submitted at: {}" .format (analysis .submitted_at ))
3940 res .append ("Status: {}" .format (analysis .status ))
@@ -46,10 +47,10 @@ def format_group_status(resp: GroupStatusResponse) -> str:
4647 """Format a group status response to a simple text representation."""
4748
4849 res = [
49- "ID: {}" .format (resp .group . identifier ),
50- "Name: {}" .format (resp .group . name or "<unnamed>" ),
51- "Created on: {}" .format (resp .group . created_at ),
52- "Status: {}" .format (resp .group . status ),
50+ "ID: {}" .format (resp .identifier ),
51+ "Name: {}" .format (resp .name or "<unnamed>" ),
52+ "Created on: {}" .format (resp .created_at ),
53+ "Status: {}" .format (resp .status ),
5354 "" ,
5455 ]
5556 return "\n " .join (res )
@@ -60,7 +61,7 @@ def format_group_list(resp: GroupListResponse) -> str:
6061 representation."""
6162
6263 res = []
63- for group in resp :
64+ for group in resp . groups :
6465 res .append ("ID: {}" .format (group .identifier ))
6566 res .append ("Name: {}" .format (group .name or "<unnamed>" ))
6667 res .append ("Created on: {}" .format (group .created_at ))
@@ -69,6 +70,21 @@ def format_group_list(resp: GroupListResponse) -> str:
6970
7071 return "\n " .join (res )
7172
73+ @staticmethod
74+ def format_project_list (resp : ProjectListResponse ) -> str :
75+ """Format an analysis group response to a simple text
76+ representation."""
77+
78+ res = []
79+ for project in resp .projects :
80+ res .append ("ID: {}" .format (project .id ))
81+ res .append ("Name: {}" .format (project .name or "<unnamed>" ))
82+ res .append ("Created on: {}" .format (project .created ))
83+ res .append ("Modified: {}" .format (project .modified ))
84+ res .append ("" )
85+
86+ return "\n " .join (res )
87+
7288 @staticmethod
7389 def format_analysis_status (resp : AnalysisStatusResponse ) -> str :
7490 """Format an analysis status response to a simple text
@@ -85,7 +101,7 @@ def format_analysis_status(resp: AnalysisStatusResponse) -> str:
85101 @staticmethod
86102 def format_detected_issues (
87103 issues_list : List [
88- Tuple [DetectedIssuesResponse , Optional [AnalysisInputResponse ]]
104+ Tuple [str , DetectedIssuesResponse , Optional [AnalysisInputResponse ]]
89105 ],
90106 ** kwargs ,
91107 ) -> str :
@@ -113,10 +129,10 @@ def format_version(resp: VersionResponse) -> str:
113129
114130 return "\n " .join (
115131 [
116- "API: {}" .format (resp .api_version ),
117- "Harvey: {}" .format (resp .harvey_version ),
118- "Maru: {}" .format (resp .maru_version ),
119- "Mythril: {}" .format (resp .mythril_version ),
120- "Hashed: {}" .format (resp .hashed_version ),
132+ "API: {}" .format (resp .api ),
133+ "Harvey: {}" .format (resp .harvey ),
134+ "Maru: {}" .format (resp .maru ),
135+ "Mythril: {}" .format (resp .mythril ),
136+ "Hashed: {}" .format (resp .hash ),
121137 ]
122138 )
0 commit comments