#! /usr/bin/python

import dbus

# get the bus
bus = dbus.SessionBus()

# Photo testing
###################
# get the object
remote = bus.get_object('org.gnome.FSpot', '/org/gnome/FSpot/PhotoRemoteControl')

# convert it to our own interface
remote_iface = dbus.Interface(remote, dbus_interface='org.gnome.FSpot.PhotoRemoteControl')

for id in remote_iface.Query (('MyTag',)):
    print id

    # photo = remote_iface.GetPhoto (id)
    properties = remote_iface.GetPhotoProperties (id)

# for id in remote_iface.GetPhotoIds ():
# 	print remote_iface.GetPhotoProperties (id)['Tags']	

# roll = remote_iface.PrepareRoll ()

# photo_id1 = remote_iface.ImportPhoto ('path', True, ['Walls'])
# print photo_id1

# photo_id2 = remote_iface.ImportPhoto ('path', True, ['Walls'])
# print photo_id2

# for id in xrange(258, 261):
#     print remote_iface.RemovePhoto (id)

# properties = remote_iface.GetPhotoProperties (220)
# print properties['Uri'], properties['Id'], properties['Tags'].split(',')


# Tags stuff
######################"
# remote = bus.get_object('org.gnome.FSpot', '/org/gnome/FSpot/TagRemoteControl')

# convert it to our own interface
# remote_iface = dbus.Interface(remote, dbus_interface='org.gnome.FSpot.TagRemoteControl')

# properties = remote_iface.GetTagById (1)
# print properties

# print remote_iface.RemoveTagById (10)

