| 49 | |
| 50 | #Begin keys.dat interactions |
| 51 | def lookupAppdataFolder(): #gets the appropriate folders for the .dat files depending on the OS. Taken from bitmessagemain.py |
| 52 | APPNAME = "PyBitmessage" |
| 53 | from os import path, environ |
| 54 | if sys.platform == 'darwin': |
| 55 | if "HOME" in environ: |
| 56 | dataFolder = path.join(os.environ["HOME"], "Library/Application support/", APPNAME) + '/' |
| 57 | else: |
| 58 | print ' Could not find home folder, please report this message and your OS X version to the Daemon Github.' |
| 59 | os._exit() |
| 60 | |
| 61 | elif 'win32' in sys.platform or 'win64' in sys.platform: |
| 62 | dataFolder = path.join(environ['APPDATA'], APPNAME) + '\\' |
| 63 | else: |
| 64 | dataFolder = path.expanduser(path.join("~", ".config/" + APPNAME + "/")) |
| 65 | return dataFolder |
| 66 | |
| 67 | def configInit(): |
| 68 | BMConfigParser().add_section('bitmessagesettings') |