Skip to content

Commit

Permalink
Added sys_info example (to be tested and refined)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen-CODE committed Apr 25, 2016
1 parent b1e5ae8 commit 943b758
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions examples/osx_ios_sysinfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from kivy.app import App
from kivy.factory import Factory
from pyobjus import autoclass
from pyobjus.dylib_manager import load_framework, INCLUDE
from plyer.facades import UniqueID

load_framework(INCLUDE.Foundation)
UIDevice = autoclass('UIDevice')
NSProcessInfo = autoclass('NSProcessInfo')
processInfo = NSProcessInfo.processInfo()

class RavenApp(App):
def build(self):
return Factory.Button()
def on_start(self):
print "Hello Raven App"
print 'ProcessName: ', processInfo.processName.cString()
print 'HostName: ', processInfo.hostName.cString()
print 'OS Version: ', processInfo.operatingSystemVersionString.cString()
print 'ProcessorCount: ', processInfo.processorCount
currentDevice = UIDevice.currentDevice()
print 'DeviceName: ', currentDevice.name.cString()
print 'SystemName: ', currentDevice.systemName.cString()
print 'UI Idiom: ', currentDevice.userInterfaceIdiom
print 'Orientation: ', currentDevice.orientation
print 'SystemVersion: ', currentDevice.systemVersion.cString()
print 'DeviceModel ', currentDevice.model.cString()
print 'LocalizedModel: ', currentDevice.localizedModel.cString()
print currentDevice.identifierForVendor.UUIDString().cString()
print 'BatteryState:', currentDevice.batteryState


if __name__ == '__main__':
RavenApp().run()

0 comments on commit 943b758

Please sign in to comment.