Can I somehow use u1sdtool
to find out which files have I published on Ubuntu One (and possibly with their public URL)? Now, I have to use the web interface for that.
1 Answer
You can't use u1sdtool for this, but you can use SyncDaemonTool
, which lets you talk to Ubuntu One's syncdaemon directly, to do what you want via a short Python script:
from twisted.internet import glib2reactor
glib2reactor.install()
from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)
from twisted.internet import reactor, defer
from ubuntuone.platform.tools import SyncDaemonTool
@defer.inlineCallbacks
def print_public_files():
print "calling"
sd = SyncDaemonTool()
pf = yield sd.get_public_files()
for f in pf:
print "%(path)s -> %(public_url)s" % f
reactor.stop()
if __name__ == "__main__":
reactor.callWhenRunning(print_public_files)
reactor.run()
You'll find documentation on everything that SyncDaemonTool
can do on the Ubuntu One developer site.