Merge pull request #302 from DivineOmega/fix_missing_logger

Fix missing logger
This commit is contained in:
Jonathan Warren 2013-07-15 08:32:26 -07:00
commit 5ca0eac7a9

View File

@ -118,8 +118,11 @@ def lookupAppdataFolder():
if "HOME" in environ:
dataFolder = path.join(os.environ["HOME"], "Library/Application Support/", APPNAME) + '/'
else:
logger.critical('Could not find home folder, please report this message and your '
'OS X version to the BitMessage Github.')
stringToLog = 'Could not find home folder, please report this message and your OS X version to the BitMessage Github.'
if 'logger' in globals():
logger.critical(stringToLog)
else:
print stringToLog
sys.exit()
elif 'win32' in sys.platform or 'win64' in sys.platform:
@ -133,7 +136,11 @@ def lookupAppdataFolder():
# Migrate existing data to the proper location if this is an existing install
try:
logger.info("Moving data folder to %s" % (dataFolder))
stringToLog = "Moving data folder to %s" % (dataFolder)
if 'logger' in globals():
logger.info(stringToLog)
else:
print stringToLog
move(path.join(environ["HOME"], ".%s" % APPNAME), dataFolder)
except IOError:
pass