diff options
author | Jay Freeman <saurik@saurik.com> | 2008-02-14 11:04:20 +0000 |
---|---|---|
committer | Jay Freeman <saurik@saurik.com> | 2008-02-14 11:04:20 +0000 |
commit | 62882fc0471895bc1a47c13e22daf35dcaafecd0 (patch) | |
tree | c5fb76fc3f64e729fdabeb9c35774e722000fd4e /data/iphone-python | |
parent | 8e60af7ad00762fb8a89ae39c771287f3c5efed4 (diff) |
Got PyObjC working.
git-svn-id: http://svn.telesphoreo.org/trunk@74 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'data/iphone-python')
-rw-r--r-- | data/iphone-python/HelloPython.app/Default.png | bin | 0 -> 590265 bytes | |||
-rwxr-xr-x | data/iphone-python/HelloPython.app/HelloPython | 2 | ||||
-rw-r--r-- | data/iphone-python/HelloPython.app/HelloPython.py | 42 | ||||
-rw-r--r-- | data/iphone-python/HelloPython.app/Info.plist | 34 | ||||
l--------- | data/iphone-python/HelloPython.app/Python | 1 | ||||
-rw-r--r-- | data/iphone-python/HelloPython.app/icon.png | bin | 0 -> 2809 bytes | |||
-rw-r--r-- | data/iphone-python/_metadata/description | 1 | ||||
l--------- | data/iphone-python/_metadata/license | 1 | ||||
l--------- | data/iphone-python/_metadata/maintainer | 1 | ||||
-rw-r--r-- | data/iphone-python/_metadata/name | 1 | ||||
-rw-r--r-- | data/iphone-python/_metadata/priority | 1 | ||||
-rw-r--r-- | data/iphone-python/_metadata/section | 1 | ||||
l--------- | data/iphone-python/_metadata/uicaboodle.py.dep | 1 | ||||
-rw-r--r-- | data/iphone-python/_metadata/version | 1 | ||||
-rw-r--r-- | data/iphone-python/make.sh | 3 |
15 files changed, 90 insertions, 0 deletions
diff --git a/data/iphone-python/HelloPython.app/Default.png b/data/iphone-python/HelloPython.app/Default.png Binary files differnew file mode 100644 index 000000000..f475d4db7 --- /dev/null +++ b/data/iphone-python/HelloPython.app/Default.png diff --git a/data/iphone-python/HelloPython.app/HelloPython b/data/iphone-python/HelloPython.app/HelloPython new file mode 100755 index 000000000..4c0b5eede --- /dev/null +++ b/data/iphone-python/HelloPython.app/HelloPython @@ -0,0 +1,2 @@ +#!/bin/bash +exec "$(dirname "$0")"/Python "$(dirname "$0")"/HelloPython.py diff --git a/data/iphone-python/HelloPython.app/HelloPython.py b/data/iphone-python/HelloPython.app/HelloPython.py new file mode 100644 index 000000000..c78b141e6 --- /dev/null +++ b/data/iphone-python/HelloPython.app/HelloPython.py @@ -0,0 +1,42 @@ +import objc +import _uicaboodle +from objc import YES, NO +objc.loadBundle('UIKit', globals(), '/System/Library/Frameworks/UIKit.framework') +UIApplication = objc.lookUpClass('UIApplication') +UITable = objc.lookUpClass('UITable') +UIWindow = objc.lookUpClass('UIWindow') +UIHardware = objc.lookUpClass('UIHardware') + +class PYApplication(UIApplication): + def applicationDidFinishLaunching_(self, unused): + frame = UIHardware.fullScreenApplicationContentRect() + self.window = UIWindow.alloc().initWithFrame_(frame) + + self.view = UIView.alloc().initWithFrame_(self.window.bounds()) + self.window.setContentView_(self.view) + + self.window.orderFront_(self) + self.window.makeKey_(self) + self.window._setHidden_(NO) + + navsize = UINavigationBar.defaultSize() + navrect = ((0, 0), navsize) + + self.navbar = UINavigationBar.alloc().initWithFrame_(navrect); + self.view.addSubview_(self.navbar) + + self.navbar.setBarStyle_(1) + self.navbar.setDelegate_(self) + + navitem = UINavigationItem.alloc().initWithTitle_('Contacts') + self.navbar.pushNavigationItem_(navitem) + + bounds = self.view.bounds() + tblrect = ((0, navsize[0]), (bounds[1][0] - navsize[0], bounds[1][1])) + + self.table = UITable.alloc().initWithFrame_(tblrect) + self.view.addSubview_(self.table) + + self.table.reloadData() + +_uicaboodle.UIApplicationMain(['HelloPython'], PYApplication) diff --git a/data/iphone-python/HelloPython.app/Info.plist b/data/iphone-python/HelloPython.app/Info.plist new file mode 100644 index 000000000..c1eb44343 --- /dev/null +++ b/data/iphone-python/HelloPython.app/Info.plist @@ -0,0 +1,34 @@ +<?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>CFBundleDevelopmentRegion</key> + <string>en</string> + + <key>CFBundleExecutable</key> + <string>HelloPython</string> + + <key>CFBundleIdentifier</key> + <string>com.saurik.HelloPython</string> + + <key>CFBundleInfoDictionaryVersion</key> + <string>6.0</string> + + <key>CFBundleName</key> + <string>HelloPython</string> + + <key>CFBundlePackageType</key> + <string>APPL</string> + + <key>CFBundleShortVersionString</key> + <string>1.0</string> + + <key>CFBundleSignature</key> + <string>????</string> + + <key>CFBundleVersion</key> + <string>1.0</string> +</dict> + +</plist> diff --git a/data/iphone-python/HelloPython.app/Python b/data/iphone-python/HelloPython.app/Python new file mode 120000 index 000000000..acd4152a9 --- /dev/null +++ b/data/iphone-python/HelloPython.app/Python @@ -0,0 +1 @@ +/usr/bin/python
\ No newline at end of file diff --git a/data/iphone-python/HelloPython.app/icon.png b/data/iphone-python/HelloPython.app/icon.png Binary files differnew file mode 100644 index 000000000..6ab79fbcb --- /dev/null +++ b/data/iphone-python/HelloPython.app/icon.png diff --git a/data/iphone-python/_metadata/description b/data/iphone-python/_metadata/description new file mode 100644 index 000000000..fea726284 --- /dev/null +++ b/data/iphone-python/_metadata/description @@ -0,0 +1 @@ +example applications (with source) in Python diff --git a/data/iphone-python/_metadata/license b/data/iphone-python/_metadata/license new file mode 120000 index 000000000..b9c4e3684 --- /dev/null +++ b/data/iphone-python/_metadata/license @@ -0,0 +1 @@ +../../../licenses/menes
\ No newline at end of file diff --git a/data/iphone-python/_metadata/maintainer b/data/iphone-python/_metadata/maintainer new file mode 120000 index 000000000..0fa66e077 --- /dev/null +++ b/data/iphone-python/_metadata/maintainer @@ -0,0 +1 @@ +../../../people/saurik
\ No newline at end of file diff --git a/data/iphone-python/_metadata/name b/data/iphone-python/_metadata/name new file mode 100644 index 000000000..bfae7cdd3 --- /dev/null +++ b/data/iphone-python/_metadata/name @@ -0,0 +1 @@ +iPhone/Python diff --git a/data/iphone-python/_metadata/priority b/data/iphone-python/_metadata/priority new file mode 100644 index 000000000..134d9bc32 --- /dev/null +++ b/data/iphone-python/_metadata/priority @@ -0,0 +1 @@ +optional diff --git a/data/iphone-python/_metadata/section b/data/iphone-python/_metadata/section new file mode 100644 index 000000000..46c5d2cde --- /dev/null +++ b/data/iphone-python/_metadata/section @@ -0,0 +1 @@ +Python diff --git a/data/iphone-python/_metadata/uicaboodle.py.dep b/data/iphone-python/_metadata/uicaboodle.py.dep new file mode 120000 index 000000000..95b4afa0a --- /dev/null +++ b/data/iphone-python/_metadata/uicaboodle.py.dep @@ -0,0 +1 @@ +../../uicaboodle.py
\ No newline at end of file diff --git a/data/iphone-python/_metadata/version b/data/iphone-python/_metadata/version new file mode 100644 index 000000000..97a6d65a2 --- /dev/null +++ b/data/iphone-python/_metadata/version @@ -0,0 +1 @@ +1.0.2308 diff --git a/data/iphone-python/make.sh b/data/iphone-python/make.sh new file mode 100644 index 000000000..e66e92cc9 --- /dev/null +++ b/data/iphone-python/make.sh @@ -0,0 +1,3 @@ +pkg: mkdir /Applications +pkg: cp -a %/HelloPython.app /Applications +pkg: find / -name '.svn' -prune -exec rm -rfv {} \; |