Skip to content

Commit

Permalink
Fix color message
Browse files Browse the repository at this point in the history
  • Loading branch information
AlessandroZ committed Feb 25, 2015
1 parent 58c8d56 commit 8987f28
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 16 deletions.
4 changes: 3 additions & 1 deletion Linux/src/config/color.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ class bcolors():
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OK = '\033[92m'
WARNING = '\033[93m'
WARNING = '\033[96m'
FAIL = '\033[91m'
TITLE = '\033[93m'
ENDC = '\033[0m'

8 changes: 4 additions & 4 deletions Linux/src/config/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class Header():
def first_title(self):
print bcolors().WARNING
print bcolors().TITLE
print '|====================================================================|'
print '| |'
print '| The LaZagne Project |'
Expand All @@ -15,16 +15,16 @@ def first_title(self):


def title(self, title):
print bcolors().WARNING
print bcolors().TITLE
print "------------------- " + title + " passwords -----------------"
print bcolors().ENDC

# info option for the logging
def title_info(self, title):
b = bcolors()
logging.info(b.WARNING + "------------------- " + title + " passwords -----------------\n" + b.ENDC)
logging.info(b.TITLE + "------------------- " + title + " passwords -----------------\n" + b.ENDC)

# debug option for the logging
def title_debug(self, title):
b = bcolors()
logging.debug(b.WARNING + "------------------- " + title + " passwords -----------------\n" + b.ENDC )
logging.debug(b.TITLE + "------------------- " + title + " passwords -----------------\n" + b.ENDC )
2 changes: 1 addition & 1 deletion Linux/src/config/write_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def print_debug(error_level, message):
logging.debug(b.FAIL + '[ERROR] ' + message + '\n' + b.ENDC)

elif error_level == 'WARNING':
logging.debug(b.FAIL + '[WARNING] ' + message + '\n' + b.ENDC)
logging.debug(b.WARNING + '[WARNING] ' + message + '\n' + b.ENDC)

elif error_level == 'INFO':
logging.debug('[INFO] ' + message + '\n')
Expand Down
12 changes: 6 additions & 6 deletions Linux/src/softwares/browsers/mozilla.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,20 +312,20 @@ def retrieve_password(self):
software_name = constant.mozilla_software
specific_path = constant.specific_path

# print the title
Header().title_debug(software_name)

# get the installation path
path = self.get_path(software_name)
if not path:
print_debug('ERROR', 'Installation path not found')
print_debug('WARNING', 'Installation path not found')
return

# print the title
Header().title_debug(software_name)

list_libnss = self.found_libnss()

# Check if the libnss could be initialized well
if not list_libnss:
print_debug('ERROR', 'The libnss have not been initialized because the libnss3.so has not been found')
print_debug('WARNING', 'The libnss have not been initialized because the libnss3.so has not been found')

#Check if mozilla folder has been found
elif not os.path.exists(path):
Expand All @@ -336,7 +336,7 @@ def retrieve_password(self):
if os.path.exists(specific_path):
profile_list = [specific_path]
else:
print_debug('ERROR', 'The following file does not exist: %s' % specific_path)
print_debug('WARNING', 'The following file does not exist: %s' % specific_path)
return
else:
profile_list = self.get_firefox_profiles(path)
Expand Down
6 changes: 3 additions & 3 deletions Linux/src/softwares/databases/sqldeveloper.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_infos(self, path, passphrase, salt):
# print the results
print_output('SQL Developer', pwdFound)
else:
print_debug('ERROR', 'The xml file containing the passwords has not been found.')
print_debug('WARNING', 'The xml file containing the passwords has not been found.')

def retrieve_password(self):

Expand All @@ -142,10 +142,10 @@ def retrieve_password(self):
passphrase = self.get_passphrase(mainPath)

if passphrase == 'Not_Found':
print_debug('ERROR', 'The passphrase used to encrypt has not been found.')
print_debug('WARNING', 'The passphrase used to encrypt has not been found.')

elif passphrase == 'xml_Not_Found':
print_debug('ERROR', 'The xml file containing the passphrase has not been found.')
print_debug('WARNING', 'The xml file containing the passphrase has not been found.')

else:
salt = self.get_salt()
Expand Down
2 changes: 1 addition & 1 deletion Linux/src/softwares/wifi/wifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ def retrieve_password(self):
# print the results
print_output('Wifi', pwdFound)
else:
print_debug('ERROR', 'the path "%s" does not exist' %(directory))
print_debug('WARNING', 'the path "%s" does not exist' %(directory))
Binary file modified Linux/standalone/LaZagne
Binary file not shown.

0 comments on commit 8987f28

Please sign in to comment.