Ubuntu One API
Create a convenience API around the existing dbus API to simplify integration with desktop applications.
Blueprint information
- Status:
- Not started
- Approver:
- Sebastien Bacher
- Priority:
- Undefined
- Drafter:
- Ken VanDine
- Direction:
- Needs approval
- Assignee:
- Ken VanDine
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
== Notes from a brainstorming session between kenvandine and sil ==
ubuntuone/public.py
def File(object):
def __init__(self, filename):
self.filename = filename
self.
self.
try:
self.metadata = dbuscall.
except:
raise FileIsNotInAnUb
def publish(self, callback, error_callback, simpleurl=True):
self.
self.
# is file synced?
if self.metadata[
# yes, yes it is
self.
else:
dbussigna
gobject.
def _fileSyncWaitTi
for callback in self.error_
callback(
dbussignalw
def _watchFileSynce
if fileThatHasBeen
# file is now synced, yay!
self.
def _publish(self, metadata, simpleurl):
dbussignalw
dbuscall(
gobject.
def _filePublishWai
for callback in self.error_
callback(
dbussignalw
def _watchFilePubli
if fileThatHasBeen
for callback in self.public_
example.py
import ubuntuone.public, gtk
def displayPublicUR
print "The URL is", publicURL
gtk.main_quit()
try:
f = ubuntuone.
f.publish(
except FileIsNotInAnUb
#copy file to U1, etc and retry
pass