(add aegis trick) |
(add python tricks section) |
||
| Line 166: | Line 166: | ||
| | | | ||
|} | |} | ||
| + | |||
| + | |||
| + | === Python tricks === | ||
| + | |||
| + | ==== QtMobility Accelerometer example ==== | ||
| + | |||
| + | <pre class="code"> | ||
| + | import sys, os | ||
| + | |||
| + | from PySide import QtCore, QtGui, QtDeclarative, QtOpenGL | ||
| + | from QtMobility import Sensors | ||
| + | |||
| + | class AccelListener(QtCore.QObject): | ||
| + | def __init__(self): | ||
| + | QtCore.QObject.__init__(self) | ||
| + | self.rotation = (0.0, 0.0, 0.0) | ||
| + | |||
| + | @QtCore.Slot() | ||
| + | def on_reading_changed(self): | ||
| + | accel = self.sender() | ||
| + | reading = accel.reading() | ||
| + | self.rotation = (reading.x(), | ||
| + | reading.y(), | ||
| + | reading.z()) | ||
| + | print "rotation = %s" % str(self.rotation) | ||
| + | |||
| + | |||
| + | app = QtGui.QApplication(sys.argv) | ||
| + | accel = Sensors.QAccelerometer() | ||
| + | |||
| + | accel_listener = AccelListener() | ||
| + | accel.readingChanged.connect(accel_listener.on_reading_changed) | ||
| + | accel.start() | ||
| + | |||
| + | sys.exit(app.exec_()) | ||
| + | </pre> | ||
I'm a python developer in real life and enjoyed hacking on my N900 so much that I wanted to continue with the N9/N950. My application for the N950 was accepted and I'm starting the two projects:
Contents |
sudo /scratchbox/sbin/sbox_ctl start && sudo /scratchbox/sbin/sbox_sync && /scratchbox/login
apt-get source python-minimal cd python-defaults-2.6.6-3+squeeze4/ dpkg-buildpackage -sa -rfakeroot -kmartin@martindengler.com fakeroot apt-get install debiandoc-sgml lsb-release dpkg-buildpackage -sa -rfakeroot -kmartin@martindengler.com aegis-manifest -d
http://repo.pub.meego.com/home:/mdengler/MeeGo_1.2_Harmattan_Maemo.org_MeeGo_1.2_Harmattan_standard/
http://wiki.meego.com/Migrating_from_N900_to_N950#GTalk_and_Skype_account_setup
qdbus --system org.freedesktop.DBus / org.freedesktop.DBus.ListNames dbus-send --system --type=method_call --print-reply --dest=com.nokia.time /com/nokia/time org.freedesktop.DBus.Introspectable.Introspect
dbus-send --system --type=method_call --print-reply --dest=com.nokia.time /com/nokia/time com.nokia.time.enable_alarms boolean:"false"
dbus-send --system --type=method_call --print-reply --dest=com.nokia.time /com/nokia/time com.nokia.time.alarms_enabled
dbus-send --system --type=method_call --print-reply --dest=com.nokia.time /com/nokia/time com.nokia.time.get_cookies_by_attributes dict:string:string:"",""
~ # ls -i /bin/sh
144908 /bin/sh
~ # sha1sum /bin/sh 7fd44caa86b259e8724f5da10adfcc7fee4e0a16 /bin/sh ~ # grep 144908 /sys/kernel/security/validator/hashlist 9990003 144908 (0,0,33261)S no 7fd44caa86b259e8724f5da10adfcc7fee4e0a16
~ # ls -i /etc/mce/mce.ini
143850 /etc/mce/mce.ini
~ # grep 143850 /sys/kernel/security/validator/hashlist
| Item | Filesystem | Backup | |
|---|---|---|---|
| Contacts | |||
| Recent Calls | |||
| Web history | |||
| Messages | |||
| Pictures (Gallery/Camera) | |||
| Music | |||
| Videos | |||
| Calendar | |||
| Documents | |||
| Feeds | |||
| Accounts | |||
| Clock (Alarms) | |||
| Settings | |||
| Notes | |||
| Autostart applications | /usr/share/autostart/tracker-miner-fs.desktop | ||
| Extensions & Status menu applications | /usr/share/meegotouch/applicationextensions | ||
| Application Launcher icons | /usr/share/applications and /usr/share/applications/installer-extra | ||
| QuickLaunch Bar Application Launcher icons | /etc/xdg/meegotouchhome-nokia/applications/ |
import sys, os
from PySide import QtCore, QtGui, QtDeclarative, QtOpenGL
from QtMobility import Sensors
class AccelListener(QtCore.QObject):
def __init__(self):
QtCore.QObject.__init__(self)
self.rotation = (0.0, 0.0, 0.0)
@QtCore.Slot()
def on_reading_changed(self):
accel = self.sender()
reading = accel.reading()
self.rotation = (reading.x(),
reading.y(),
reading.z())
print "rotation = %s" % str(self.rotation)
app = QtGui.QApplication(sys.argv)
accel = Sensors.QAccelerometer()
accel_listener = AccelListener()
accel.readingChanged.connect(accel_listener.on_reading_changed)
accel.start()
sys.exit(app.exec_())