Permalink
Browse files

Replaced Aete2sdef with a python script that outputs the sdef and hea…

…der files for the current version of iTunes.
  • Loading branch information...
1 parent 8467f3f commit 191ea92c16ecc5d7a81b09cc3bdc464d7882ecb2 @kgn committed Jun 23, 2011
View
51 Aete2sdef1.1/Aete2sdef.app/Contents/Info.plist
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
-<plist version="0.9">
-<dict>
- <key>CFBundleIdentifier</key>
- <string>fr.bdesgraupes.aete2sdef</string>
- <key>CFBundleName</key>
- <string>Aete2sdef</string>
- <key>CFBundleShortVersionString</key>
- <string>Aete2sdef 1.1</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleSignature</key>
- <string>AE2S</string>
- <key>CFBundleExecutable</key>
- <string>Aete2sdef</string>
- <key>CFBundleVersion</key>
- <string>1.1</string>
- <key>CFBundleHelpBookFolder</key>
- <string>Aete2sdefHelp</string>
- <key>CFBundleHelpBookName</key>
- <string>Aete2sdef Help</string>
- <key>CFBundleDevelopmentRegion</key>
- <string>English</string>
- <key>CFBundleInfoDictionaryVersion</key>
- <string>6.0</string>
- <key>LSRequiresCarbon</key>
- <true/>
- <key>CFBundleDocumentTypes</key>
- <array>
- <dict>
- <key>CFBundleTypeName</key>
- <string>Rezilla Resource File</string>
- <key>CFBundleTypeIconFile</key>
- <string>RezillaDocs.icns</string>
- <key>CFBundleTypeRole</key>
- <string>Viewer</string>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>RSRC</string>
- <string>****</string>
- </array>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>rsrc</string>
- <string>*</string>
- </array>
- </dict>
- </array>
-</dict>
-</plist>
View
BIN Aete2sdef1.1/Aete2sdef.app/Contents/MacOS/Aete2sdef
Binary file not shown.
View
1 Aete2sdef1.1/Aete2sdef.app/Contents/PkgInfo
@@ -1 +0,0 @@
-APPLAE2S
View
BIN Aete2sdef1.1/Aete2sdef.app/Contents/Resources/Aete2sdef.rsrc
Binary file not shown.
View
1 Aete2sdef1.1/Aete2sdef.app/Contents/Resources/English.lproj/Aete2sdefHelp/index.html
@@ -1 +0,0 @@
-<HTML>
View
BIN Aete2sdef1.1/Aete2sdef.app/Contents/Resources/English.lproj/InfoPlist.strings
Binary file not shown.
View
BIN Aete2sdef1.1/Aete2sdef.app/Contents/Resources/English.lproj/Localizable.strings
Binary file not shown.
View
1 Aete2sdef1.1/Aete2sdefHelp.html
@@ -1 +0,0 @@
-<HTML>
View
8 Aete2sdef1.1/Aete2sdef_HomePage.webloc
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>URL</key>
- <string>http://perso.orange.fr/bdesgraupes/DocHTML/Aete2sdefHelp.html</string>
-</dict>
-</plist>
View
BIN Aete2sdef1.1/Scripts/Aete2sdef.asdictionary
Binary file not shown.
View
1 Aete2sdef1.1/Scripts/ConvertAete.scr
@@ -1 +0,0 @@
-(* Description Convert the aete ressources contained in the chosen file to sdef files *) tell application "Aete2sdef" set theFile to (choose file) convert theFile end tell
View
1 Aete2sdef1.1/Scripts/GetVersion.scr
@@ -1 +0,0 @@
-(* Description Get the current version number of Aete2sdef *) tell application "Aete2sdef" get version end tell
View
45 iTunes.py
@@ -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))

0 comments on commit 191ea92

Please sign in to comment.