[tomboy-list] Tomboy not respecting changes to XML metadata via dbus API?
Jens Knutson
jens.knutson at gmail.com
Mon May 10 21:24:22 PDT 2010
Hi,
I'm trying to modify the size of notes via the dbus API, grabbing them
with GetNoteCompleteXml(), changing <width> and/or <length>, and then
pushing the contents back out via SetNoteCompleteXml(). However, Tomboy
doesn't seem to respect the new size tag(s), and reverts them back to
what they were prior to SetNoteCompleteXml().
Here's a quick Python script to repro the issue:
#!/usr/bin/env python
import dbus
notes_proxy = dbus.SessionBus().get_object('org.gnome.Tomboy', '/org/gnome/Tomboy/RemoteControl')
old_width_tag, new_width_tag = "<width>450</width>", "<width>800</width>"
uri = notes_proxy.CreateNamedNote("A note I would like to resize")
notes_proxy.DisplayNote(uri)
notes_proxy.HideNote(uri)
new_width_xml = notes_proxy.GetNoteCompleteXml(uri).replace(old_width_tags, new_width_tags)
notes_proxy.SetNoteCompleteXml(uri, new_width_xml)
unchanged_size_xml = notes_proxy.GetNoteCompleteXml(uri)
index = unchanged_size_xml.find("<width>") + len("<width>")
print unchanged_size_xml[index:index + 3]
Is this a bug I should file, or am I doing something wrong?
Thanks,
Jens
--
"We act as though comfort and luxury were the chief requirements in
life, when all we need to make us really happy is something to be
enthusiastic about."
- Charles Kingsley
More information about the Tomboy-list
mailing list