added dumping logs on error

This commit is contained in:
aj 2019-05-14 13:05:25 +01:00
parent 2046dda356
commit fa7748b0ae
2 changed files with 42 additions and 31 deletions

View File

@ -8,13 +8,16 @@ import datetime
def checkPhone(): def checkPhone():
response = os.system("ping -c 1 -w5 " + os.environ['PHONEIP'] + " > /dev/null 2>&1") response = os.system("ping -c 1 -w5 " + os.environ['PHONEIP'] + " > /dev/null 2>&1")
print('checking for phone') log.log('checking for phone')
if response == 0: if response == 0:
return True return True
else: else:
return False return False
if __name__ == '__main__': if __name__ == '__main__':
try:
network = networkclass.network(userclass.User()) network = networkclass.network(userclass.User())
found = False found = False
@ -39,3 +42,6 @@ if __name__ == '__main__':
network.next() network.next()
log.dumpLog() log.dumpLog()
except:
log.dumpLog()

View File

@ -9,6 +9,8 @@ import os
if __name__ == '__main__': if __name__ == '__main__':
try:
network = networkclass.network(userclass.User()) network = networkclass.network(userclass.User())
playlists = network.getUserPlaylists() playlists = network.getUserPlaylists()
@ -28,3 +30,6 @@ if __name__ == '__main__':
csvwrite.exportPlaylist(play, totalpath) csvwrite.exportPlaylist(play, totalpath)
log.dumpLog() log.dumpLog()
except:
log.dumpLog()