| The Following 4 Users Say Thank You to jdarnell For This Useful Post: | ||
|
|
2009-07-27
, 07:25
|
|
|
Posts: 52 |
Thanked: 27 times |
Joined on Mar 2008
@ Berlin, Germany
|
#12
|
I'm not sure which Python packages you might need to install, if any, to make use of this script. Please let me know if you find out what pre-requisite packages it requires.Can you please help? What is this "Python package" that he is talking about? In my installer I see many programs that start with Py..., but which one do I need to install for this purpose? Unfortunately I am no Linux pro.
|
|
2009-07-27
, 08:56
|
|
|
Posts: 2,142 |
Thanked: 2,054 times |
Joined on Dec 2006
@ Sicily
|
#13
|
In my installer I see many programs that start with Py..., but which one do I need to install for this purpose? Unfortunately I am no Linux pro.
ii hildon-desktop-python-loader 0.0.2-1 Hildon Desktop Python Plugin Loader ii python-dateutil 1.4.1-1 Extension to the standard python datetime mo ii python-gdata 1.2.3-0maemo2 Google Data Python client library ii python-sqlite 1.0.1-7maemo2 python interface to SQLite 2 ii python2.5 2.5.2-1osso4 An interactive high-level object-oriented la ii python2.5-beautifulsoup 3.0.7-0maemo2 error-tolerant HTML parser for Python ii python2.5-bluez 0.9.1-1osso2 Python wrappers around BlueZ ii python2.5-cairo 1.4.0-1osso2 Python bindings for the Cairo vector graphic ii python2.5-conic 0.1-1osso2 Python bindings for ConIc Framework. ii python2.5-dbus 0.82-4osso2 Python wrappers around D-Bus. ii python2.5-gnome 2.18.0-1osso3 Python bindings for GConf and GnomeVFS ii python2.5-gobject 2.14.1-1osso2 Python bindings for the GTK+ widget set ii python2.5-gpsbt 0.1-18osso2 Python bindings for osso-gpsd lib. ii python2.5-gstreamer 0.10.5-0osso2 generic media-playing framework (Python bind ii python2.5-gtk2 2.12.1-1osso3 Python bindings for the GTK+ widget set ii python2.5-hildon 0.8.9-1osso2 Python bindings for Hildon Framework. ii python2.5-hildondesktop 0.0.2-1 Python bindings for libhildondesktop ii python2.5-id3lib 0.5.1-1osso2 id3lib wrapper for Python - library ii python2.5-imaging 1.1.6-1osso2 Python Imaging Library ii python2.5-numeric 24.2-1osso5 Numerical (matrix-oriented) Mathematics for ii python2.5-osso 0.3-1osso4 Python bindings for Libosso library ii python2.5-pycurl 7.15.5-1osso3 Python bindings for libcurl. ii python2.5-pygame 1.7.1-1osso2 SDL bindings for games development in Python ii python2.5-runtime c1.0-6 Python runtime environment. ii python2.5-xml 0.8.4-1osso9 XML tools for Python
import os import gtk import dbus import dbus.service import dbus.glib
|
|
2009-07-27
, 10:18
|
|
|
Posts: 246 |
Thanked: 204 times |
Joined on Jun 2007
@ Potsdam (Germany)
|
#14
|
@Bunduo: Thanks again for your suggestions. I was able to get everything functioning! I've replaced Microb with Midori!
[...]
|
|
2009-07-28
, 09:49
|
|
|
Posts: 52 |
Thanked: 27 times |
Joined on Mar 2008
@ Berlin, Germany
|
#15
|

|
|
2009-08-27
, 08:34
|
|
|
Posts: 52 |
Thanked: 27 times |
Joined on Mar 2008
@ Berlin, Germany
|
#16
|
#!/usr/bin/python
# browser-proxy.py
# version 1.4 by xiojason
# simple python-dbus service that proxies osso_browser events to Tear
# based on code from http://paste.lisp.org/display/45824
#
# installation:
# 1. place this file in /home/user as browser-proxy.py
# 2. make executable (chmod +x browser-proxy.py)
# 3. change /usr/share/dbus-1/services/com.nokia.osso_browser.service to read:
# [D-BUS Service]
# Name=com.nokia.osso_browser
# Exec=/home/user/browser-proxy.py
# 4. disable tablet-browser-service (aka browserd) (optional, saves memory)
# 5. you may wish to reboot.
#
# notes:
# - opening urls will be a bit slow. it takes some time to relay the messages to Tear
# - modifying the osso_browser.service file prevents MicroB/browserd from working.
# if you wish to restore MicroB/browserd, change the service file's contents back to:
# [D-BUS Service]
# Name=com.nokia.osso_browser
# Exec=/usr/bin/browser
# and re-enable tablet-browser-service again.
#
# revision history:
# 1.0
# 1.1 -> fixed wrong capitalization in dbus message
# 1.2 -> removed return values, added osso_browser/request namespace (fixes Pidgin)
# 1.3 -> sniff for local paths, prefix with file:// (fixes feedcircuit)
# 1.4 -> can now manually launch MicroB/browser -- while open, it will be used instead
# -- without --print-reply, the initial launching message seems to get lost
# 1.5 -> removed dbus-launch that caused other software to hang. Used subprocess to
# spawn new processes instead of replacing the current process, which DBUS wasn't
# taking to well.
import sys
import os
import gtk
import dbus
import dbus.service
import dbus.glib
import subprocess
def log(message):
outf = open("/tmp/bp.log", "a")
outf.write(message)
outf.write("\n")
outf.close()
class ProxyBrowserService(dbus.service.Object):
def __init__(self):
bus_name = dbus.service.BusName('com.nokia.osso_browser', bus=dbus.SessionBus())
dbus.service.Object.__init__(self, bus_name, '/com/nokia/osso_browser')
dbus.service.Object.__init__(self, bus_name, '/com/nokia/osso_browser/request')
def OpenAddress(self, uri):
log(uri)
if uri[0] == '/':
print "prefixing apparent local path with file://"
uri = "file://" + uri
subprocess.Popen(['/usr/bin/midori', uri])
@dbus.service.method(dbus_interface='com.nokia.osso_browser', in_signature='s')
def load_url(self, uri):
log("load_url")
self.OpenAddress(uri)
@dbus.service.method(dbus_interface='com.nokia.osso_browser', in_signature='s')
def open_new_window(self, uri):
log("open_new_window")
self.OpenAddress(uri)
@dbus.service.method(dbus_interface='com.nokia.osso_browser')
def top_application(self):
log("top_application")
if os.system("lsof /usr/sbin/browserd") != 0:
os.system("/usr/sbin/browserd -d")
os.execl('/usr/bin/browser', '/usr/bin/browser')
pbrowser = ProxyBrowserService()
log("before main")
try:
gtk.main()
except:
log("error")
log(repr(sys.exc_info()))
log("after main")
|
|
2009-08-27
, 13:12
|
|
|
Posts: 4,783 |
Thanked: 1,253 times |
Joined on Aug 2007
@ norway
|
#17
|
|
|
2009-08-27
, 13:56
|
|
|
Posts: 52 |
Thanked: 27 times |
Joined on Mar 2008
@ Berlin, Germany
|
#18
|
|
|
2009-08-27
, 13:57
|
|
|
Posts: 4,783 |
Thanked: 1,253 times |
Joined on Aug 2007
@ norway
|
#19
|
|
|
2009-08-27
, 15:07
|
|
|
Posts: 52 |
Thanked: 27 times |
Joined on Mar 2008
@ Berlin, Germany
|
#20
|
Now the tablet is so much more useful. I'll put the modified script below so anyone else searching for this can implement it.
Thanks every one!
import os import gtk import dbus import dbus.service import dbus.glib class ProxyBrowserService(dbus.service.Object): def __init__(self): bus_name = dbus.service.BusName('com.nokia.osso_browser', bus=dbus.SessionBus()) dbus.service.Object.__init__(self, bus_name, '/com/nokia/osso_browser') dbus.service.Object.__init__(self, bus_name, '/com/nokia/osso_browser/request') def OpenAddress(self, uri): print uri if uri[0] == '/': print "prefixing apparent local path with file://" uri = "file://" + uri os.execl('/usr/bin/dbus-launch', '/usr/bin/dbus-launch', 'midori', uri) @dbus.service.method(dbus_interface='com.nokia.osso_browser', in_signature='s') def load_url(self, uri): print "load_url" self.OpenAddress(uri) @dbus.service.method(dbus_interface='com.nokia.osso_browser', in_signature='s') def open_new_window(self, uri): print "open_new_window" self.OpenAddress(uri) @dbus.service.method(dbus_interface='com.nokia.osso_browser') def top_application(self): print "top_application" if os.system("lsof /usr/sbin/browserd") != 0: os.system("/usr/sbin/browserd -d") os.execl('/usr/bin/browser', '/usr/bin/browser') pbrowser = ProxyBrowserService() gtk.main()