From 4c0624663bb19226c458463f7b5a38108949d2be Mon Sep 17 00:00:00 2001
From: Maran <maran.hidskes@gmail.com>
Date: Thu, 29 Nov 2012 21:20:44 +0100
Subject: [PATCH] Removed PyObjc dependency for OSX

---
 bitmessagemain.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/bitmessagemain.py b/bitmessagemain.py
index 9cb75100..e8aeb818 100644
--- a/bitmessagemain.py
+++ b/bitmessagemain.py
@@ -3415,12 +3415,12 @@ if __name__ == "__main__":
     APPNAME = "PyBitmessage"
     from os import path, environ
     if sys.platform == 'darwin':
-        from AppKit import NSSearchPathForDirectoriesInDomains
-        # http://developer.apple.com/DOCUMENTATION/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSearchPathForDirectoriesInDomains
-        # NSApplicationSupportDirectory = 14
-        # NSUserDomainMask = 1
-        # True for expanding the tilde into a fully qualified path
-        appdata = path.join(NSSearchPathForDirectoriesInDomains(14, 1, True)[0], APPNAME) + '/'
+        if "HOME" in environ:
+            appdata = path.join(os.environ["HOME"], "Library/Application support/", APPNAME) + '/'
+        else:
+            print 'Could not find home folder, please report this message and your OS X version to the BitMessage Github.'
+            sys.exit()
+
     elif 'win' in sys.platform:
         appdata = path.join(environ['APPDATA'], APPNAME) + '\\'
     else: