forked from kgn/LaunchAtLoginHelper
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
22 lines (16 loc) · 738 Bytes
/
setup.py
File metadata and controls
22 lines (16 loc) · 738 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import sys, os
import plistlib
urlScheme = sys.argv[1]
bundleIdentifier = sys.argv[2]
directory = os.path.dirname(os.path.abspath(__file__))
stringsOutput = os.path.join(directory, 'LLStrings.h')
infoPlistOutput = os.path.join(directory, 'LaunchAtLoginHelper/LaunchAtLoginHelper-Info.plist')
infoPlist = plistlib.readPlist(os.path.join(directory, 'LaunchAtLoginHelper/LaunchAtLoginHelper-InfoBase.plist'))
with open(stringsOutput, 'w') as strings:
strings.write("""// strings used by LLManager and LaunchAtLoginHelper
//
#define LLURLScheme @"%(urlScheme)s"
#define LLHelperBundleIdentifier @"%(bundleIdentifier)s"
"""%locals())
infoPlist['CFBundleIdentifier'] = bundleIdentifier
plistlib.writePlist(infoPlist, infoPlistOutput)