Notices


Reply
Thread Tools
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#1
I've almost complete a new app, but i need to use the calendar import feature of the default calendar. Generating an ics file and opening it via file manager works. How can I automate this operation? I've tried of course from cli, but "of course" osso-filemanager accepts no arguments.
So the question is: what are file bindings or whatever they're called, that we can launch skipping file-manager? ie: can we use the sharing file fun. from outside? etc.

Last edited by erniadeldesktop; 2010-09-30 at 12:41. Reason: more pertinent title
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#2
ok, sorry guys i didn't know i should have to use dbus & mime types. can someone be so kind and help me find the dbus-send command for opening a file in calendar?
 
Posts: 1,751 | Thanked: 844 times | Joined on Feb 2010 @ Sweden
#3
Originally Posted by erniadeldesktop View Post
ok, sorry guys i didn't know i should have to use dbus & mime types. can someone be so kind and help me find the dbus-send command for opening a file in calendar?
You could use D-feet or dbus-monitor to find out the right strings.. i am not aware what the dbus for the calender is.
__________________
You like what i do? Donate!

Make your desktop look awesome - use the AwOken Theme with the AwOken Icon Theme.

Add me on twitter @almehdin
Visit the swedish maemo/meego community forums
 

The Following User Says Thank You to AlMehdi For This Useful Post:
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#4
just in case someone else looks for it this is how to use it in a python function. The bold part is the dbus call.
Code:
def on_actionSync_triggered(self):
	import os
	self.cal.parse_events()
	try:
	    os.system('dbus-send --type=method_call --dest=com.nokia.calendar /com/nokia/calendar com.nokia.calendar.mime_open string:"file:///$1"')
	except: print "you should be using me on maemo5"
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#5
ok, seemed nice but there's something wrong: the calendar application crashes with an "error encountered". But opening the file via file manager works. what I'm missing? should I register the application somehow?
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#6
and this is the dbus monitor out, just in case ...
Code:
method call sender=:1.301 -> dest=com.nokia.calendar serial=17 path=/com/nokia/calendar; interface=com.nokia.calendar; member=mime_open
   string "file:///home/user/MyDocs/todoy.ics"
tnx
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#7
oh, and is working also via cepiperez filebox but only sometimes with his "openfile" script
 
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#8
I know that I'm quite boring, but I really need someone help with this.

this is the full dbus-monitor out, opening via filebox.
Code:
signal sender=org.freedesktop.DBus -> dest=:1.145 serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string ":1.145"
method call sender=:1.145 -> dest=org.freedesktop.DBus serial=3 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_call'"
method call sender=:1.145 -> dest=org.freedesktop.DBus serial=4 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='method_return'"
method call sender=:1.145 -> dest=org.freedesktop.DBus serial=5 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='error'"
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=29 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.146"
   string ""
   string ":1.146"
method call sender=:1.146 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
method call sender=:1.146 -> dest=org.gtk.vfs.Daemon serial=2 path=/org/gtk/vfs/mounttracker; interface=org.gtk.vfs.MountTracker; member=listMountableInfo
method return sender=:1.9 -> dest=:1.146 reply_serial=2
   array [
      struct {
         string "sftp"
         string "sftp"
         array [
            string "ssh"
         ]
         int32 22
         boolean true
      }
      struct {
         string "http"
         string "http"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "trash"
         string "trash"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "obex"
         string "obex"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "computer"
         string "computer"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "network"
         string "network"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "dav"
         string "dav"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "localtest"
         string "localtest"
         array [
         ]
         int32 0
         boolean false
      }
      struct {
         string "ftp"
         string "ftp"
         array [
         ]
         int32 21
         boolean true
      }
      struct {
         string "burn"
         string "burn"
         array [
         ]
         int32 0
         boolean false
      }
   ]
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=30 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string ":1.147"
   string ""
   string ":1.147"
method call sender=:1.147 -> dest=org.freedesktop.DBus serial=1 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=Hello
signal sender=org.freedesktop.DBus -> dest=(null destination) serial=31 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "com.nokia.osso-filemanager"
   string ""
   string ":1.147"
method call sender=:1.147 -> dest=org.freedesktop.DBus serial=2 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "com.nokia.osso-filemanager"
   uint32 1
method call sender=:1.147 -> dest=com.nokia.calendar serial=3 path=/com/nokia/calendar; interface=com.nokia.calendar; member=mime_open
   string "file:///home/user/.todoy/todoy.ics"
method call sender=:1.147 -> dest=com.nokia.HildonDesktop.AppMgr serial=4 path=/com/nokia/HildonDesktop/AppMgr; interface=com.nokia.HildonDesktop.AppMgr; member=LaunchApplication
   string ""
method return sender=:1.35 -> dest=:1.147 reply_serial=4
method return sender=:1.144 -> dest=:1.147 reply_serial=3
error sender=:1.144 -> dest=:1.147 error_name=org.freedesktop.DBus.Error.UnknownMethod reply_serial=3
   string "Method "mime_open" with signature "s" on interface "com.nokia.calendar" doesn't exist
"
 
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#9
Originally Posted by erniadeldesktop View Post
just in case someone else looks for it this is how to use it in a python function. The bold part is the dbus call.
Code:
def on_actionSync_triggered(self):
	import os
	self.cal.parse_events()
	try:
	    os.system('dbus-send --type=method_call --dest=com.nokia.calendar /com/nokia/calendar com.nokia.calendar.mime_open string:"file:///$1"')
	except: print "you should be using me on maemo5"
Just a simple example:

Code:
import os           
import dbus                                 
                                            
bus = dbus.SessionBus()                     
proxy=bus.get_object('com.nokia.calendar','/com/nokia/calendar')
iface=dbus.Interface(proxy,dbus_interface='com.nokia.calendar') 
iface.mime_open('file:///home/user/MyDocs/GermanHolidays.ics')
And it works.
There must be something other wrong with your code.

I am not good in python, and don't know
how $1 will be replaced, but maybe it should be
outside of the single quote?


os.system('dbus-send --type=method_call --dest=com.nokia.calendar /com/nokia/calendar com.nokia.calendar.mime_open string:"file:///$1"')

regards
Nicolai
 

The Following User Says Thank You to nicolai For This Useful Post:
Posts: 161 | Thanked: 85 times | Joined on Feb 2010
#10
is working now.. thanks. Really! I owe you one...
__________________
--todoy--
 
Reply


 
Forum Jump


All times are GMT. The time now is 05:53.