Commits

Ronald Oussoren committed 5004c63

Update metadata; adjust example code

  • Participants
  • Parent commits 3dd7f2d

Comments (0)

Files changed (4)

pyobjc-framework-CoreLocation/Examples/WhereIsMyMac/WhereIsMyMacAppDelegate.py

 //  appreciated but not required.
 """
 
-from Cocoa import *
+import objc
+import Cocoa
+import CoreLocation
 import WebKit
 from CoreLocation import *
 import math
 
-class WhereIsMyMacAppDelegate (NSObject):
+class WhereIsMyMacAppDelegate (Cocoa.NSObject):
     window = objc.ivar()
     webView = objc.IBOutlet()
     locationManager = objc.ivar()
 
 
     def applicationDidFinishLaunching_(self, notification):
-	self.locationManager = CLLocationManager.alloc().init()
+	self.locationManager = CoreLocation.CLLocationManager.alloc().init()
 	self.locationManager.setDelegate_(self)
 	self.locationManager.startUpdatingLocation()
 
     def openInDefaultBrowser_(self, sender):
 	currentLocation = locationManager.location()
 	
-	externalBrowserURL = NSURL.URLWithString_(
+	externalBrowserURL = Cocoa.NSURL.URLWithString_(
 		u"http://maps.google.com/maps?ll=%f,%f&spn=%f,%f"%(
                     currentLocation.coordinate.latitude,
                     currentLocation.coordinate.longitude,
                     WhereIsMyMacAppDelegate.latitudeRangeForLocation_(currentLocation),
                     WhereIsMyMacAppDelegate.longitudeRangeForLocation_(currentLocation)))
 
-	NSWorkspace.sharedWorkspace.openURL_(externalBrowserURL)
+	Cocoa.NSWorkspace.sharedWorkspace.openURL_(externalBrowserURL)
 
     def locationManager_didUpdateToLocation_fromLocation_(self, 
             manager, newLocation, oldLocation):
 
 	# Load the HTML for displaying the Google map from a file and replace the
 	# format placeholders with our location data
-        path = NSBundle.mainBundle().pathForResource_ofType_(u"HTMLFormatString", u"html")
+        path = Cocoa.NSBundle.mainBundle().pathForResource_ofType_(u"HTMLFormatString", u"html")
         htmlString = open(path, 'r').read() % (
 		newLocation.coordinate().latitude,
 		newLocation.coordinate().longitude,
 
     def locationManager_didFailWithError_(self, manager, error):
 	self.webView.mainFrame.loadHTMLString_baseURL_(
-                NSLocalizedString(u"Location manager failed with error: %s", nil) % (
+                Cocoa.NSLocalizedString(u"Location manager failed with error: %s", nil) % (
                     error.localizedDescription()), None)
 	self.locationLabel.setStringValue_(u"")
 	self.accuracyLabel.setStringValue_(u"")

pyobjc-framework-CoreLocation/Lib/CoreLocation/_metadata.py

 # This file is generated by objective.metadata
 #
-# Last update: Wed Jun 27 17:03:19 2012
+# Last update: Wed Sep 19 16:12:12 2012
 
 import objc, sys
 

pyobjc-framework-CoreLocation/metadata/raw/i386-10.8.fwinfo

 #             GENERATED FILE DO NOT EDIT
 #
 # This file was generated by objective.metadata
-# Last update: Wed Jun 27 15:37:16 2012
+# Last update: Wed Sep 19 16:10:26 2012
 {
  "arch": "i386", 
  "definitions": {
   "CLPlacemark.h", 
   "CLRegion.h"
  ], 
- "release": "10.8", 
+ "release": "10.8.1", 
  "sdk": "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"
 }

pyobjc-framework-CoreLocation/metadata/raw/x86_64-10.8.fwinfo

 #             GENERATED FILE DO NOT EDIT
 #
 # This file was generated by objective.metadata
-# Last update: Wed Jun 27 15:36:51 2012
+# Last update: Wed Sep 19 16:10:47 2012
 {
  "arch": "x86_64", 
  "definitions": {
   "CLPlacemark.h", 
   "CLRegion.h"
  ], 
- "release": "10.8", 
+ "release": "10.8.1", 
  "sdk": "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk"
 }