Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced Aete2sdef with a python script that outputs the sdef and hea…
…der files for the current version of iTunes.
- Loading branch information
Showing
13 changed files
with
45 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
1 change: 0 additions & 1 deletion
1
Aete2sdef1.1/Aete2sdef.app/Contents/Resources/English.lproj/Aete2sdefHelp/index.html
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-306 Bytes
Aete2sdef1.1/Aete2sdef.app/Contents/Resources/English.lproj/InfoPlist.strings
Binary file not shown.
Binary file removed
BIN
-1.54 KB
Aete2sdef1.1/Aete2sdef.app/Contents/Resources/English.lproj/Localizable.strings
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env python | ||
|
||
# Update the AppleScript information for iTunes | ||
|
||
from __future__ import with_statement | ||
|
||
import os | ||
import plistlib | ||
import subprocess | ||
import xml.dom.minidom | ||
|
||
k_iTunesApp = '/Applications/iTunes.app' | ||
k_iTunesDir = os.path.abspath('./iTunes') | ||
|
||
def GetVersion(): | ||
'''Get the current iTunes version''' | ||
infoPlist = os.path.join(k_iTunesApp, 'Contents', 'Info.plist') | ||
return plistlib.readPlist(infoPlist)['CFBundleVersion'] | ||
|
||
def SaveSdef(output): | ||
'''Save the iTunes sdef xml to disk''' | ||
proc = subprocess.Popen('sdef %s' % k_iTunesApp, shell=True, | ||
stdout=subprocess.PIPE, stderr=subprocess.PIPE | ||
) | ||
stdout, stderr = proc.communicate() | ||
if stderr: | ||
raise RuntimeError(stderr) | ||
dom = xml.dom.minidom.parseString(stdout.strip()) | ||
with open(output, 'w') as file: | ||
file.write(dom.toprettyxml(encoding='utf-8')) | ||
|
||
def SaveHeader(output): | ||
'''Save the iTunes header file to disk''' | ||
proc = subprocess.Popen('sdef %s | sdp -fh --basename iTunes -o "%s"' % (k_iTunesApp, output), | ||
shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE | ||
) | ||
stdout, stderr = proc.communicate() | ||
if stderr: | ||
raise RuntimeError(stderr) | ||
|
||
if __name__ == '__main__': | ||
version = GetVersion() | ||
basename = 'iTunes%s' % version | ||
SaveHeader(os.path.join(k_iTunesDir, '%s.h' % basename)) | ||
SaveSdef(os.path.join(k_iTunesDir, '%s.sdef' % basename)) |