Closed gregneagle closed 9 years ago
I get the error:
line 31, in <module>
['/usr/bin/getconf', 'DARWIN_USER_DIR']).read().rstrip()
AttributeError: 'str' object has no attribute 'read'
That's what I get for not testing on Yosemite. subprocess.check_output returns a string, so no need for the read() call. Should be:
darwin_user_dir = subprocess.check_output(
['/usr/bin/getconf', 'DARWIN_USER_DIR']).rstrip()
Cool. It works as expected now! Thanks so much! I'm going to make one more change that was bugging me when I was testing this out:
Changing the verbiage to banners
and alerts
(plural) as so it is consistent with the GUI wording.
Good! I have more PRs coming...
I've done some clean up: previously there was a mix of tabs and spaces for indentation; now it's all consistently spaces as is recommended by most Python developers.
Second: I replaced all path construction with os.path.join() which is smarter than simply using "+"
Third: I converted all calls of external utilities to use subprocess, full paths, and not use the shell, again, all good Python style.
Hope you find these changes helpful!