8 session_bus
= dbus
.SessionBus()
10 local_module_dir
= os
.path
.join(os
.path
.dirname(sys
.argv
[0]), '..', 'src')
11 if os
.path
.isdir(local_module_dir
):
12 sys
.path
.append(local_module_dir
)
14 if os
.path
.exists(sys
.argv
[-1]) and len(sys
.argv
) > 1:
15 filename
= sys
.argv
[-1]
20 remote_object
= session_bus
.get_object('org.panucci', '/player')
21 print 'Found panucci instance already running, will try to use it...'
22 except dbus
.exceptions
.DBusException
:
25 if remote_object
is None:
26 from panucci
import panucci
27 # This could eventually be made fancy with optparse
28 debug
= '--debug' in sys
.argv
29 panucci
.run(filename
=filename
, debug
=debug
)
32 remote_object
.show_main_window(dbus_interface
='org.panucci.interface')
34 remote_object
.play_file(filename
, dbus_interface
='org.panucci.interface')