Skip to content

Commit

Permalink
Updated Logic. Added Color coding
Browse files Browse the repository at this point in the history
  • Loading branch information
DigvijayBhosale1729 authored and shubhangi013 committed Oct 27, 2021
1 parent 16209b2 commit 5ae5bd5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions securetea/lib/notifs/secureTeaMalwareAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def runner(self):
else:
print(globals.WARNING + 'Given Filename does not exist. ' + globals.END)
except KeyboardInterrupt:
print('Keyboard Interrupt detected. Quitting .....')
print(globals.WARNING + 'Keyboard Interrupt detected. Quitting .....' + globals.END)
exit(0)

try:
Expand All @@ -51,26 +51,26 @@ def runner(self):
api_key = input("Enter API_KEY\n\t:")
validity_code = self.check_api_key(api_key=api_key)
if validity_code == 0:
print("API KEY Valid")
print(globals.OKBLUE + "API KEY Valid" + globals.END)
self.api_key = api_key
break
elif validity_code == 1:
print("API KEY Invalid")
print(globals.FAIL + "API KEY Invalid" + globals.END)
elif validity_code == 2:
print("secureta/lib/notifs/val_file/cat.jpg seems to be missing....\n"
"If cat.jpg is missing, create a cat.jpg file (Download from the internet is easiest")
print(globals.WARNING + "secureta/lib/notifs/val_file/cat.jpg seems to be missing....\n"
"If cat.jpg is missing, create a cat.jpg file (Download from the internet is easiest" + globals.END)
elif validity_code == 3:
print("Some unknown error occurred")
print(globals.ALERT + "Some unknown error occurred" + globals.END)
else:
print("Some error with the API Occurred")
print(globals.ALERT + "Some error with the API Occurred" + globals.END)
else:
pass

else:
print("Validity of API KEY will not be checked.")
self.api_key = input("Enter API_KEY\n\t:")
except KeyboardInterrupt:
print('Keyboard Interrupt detected. Quitting .....')
print(globals.WARNING + 'Keyboard Interrupt detected. Quitting .....' + globals.END)
exit(0)

if self.mode.lower() == 'c':
Expand All @@ -91,7 +91,7 @@ def runner(self):
m_analysis = MalwareAnalysis(filename=self.filename, API_KEY=self.api_key)
m_analysis.runner()
else:
print("Incorrect option selected")
print(globals.WARNING + 'Incorrect option selected' + globals.END)
return

def check_api_key(self, api_key):
Expand Down

0 comments on commit 5ae5bd5

Please sign in to comment.