import toolbox
-class FileManager(object):
+class FileBackend(object):
def __init__(self, filename):
self._filename = filename
projDetails["isVisible"] = False
def get_projects(self):
- return (projectDetails for projectDetails in self._projects.itervalues())
+ return self._projects.itervalues()
def get_project(self, projId):
return self._projects[projId]
return todoList[0]
def get_locations(self):
- return (locDetails for locDetails in self._locations.itervalues())
+ return self._locations.itervalues()
def get_tasks_with_details(self, projId):
return (
-class NullManager(object):
+class NullBackend(object):
def __init__(self, username, password, token=None):
pass
self._todoBox = widgetTree.get_widget("todoBox")
self._todoAreaFiller = gtk.Label()
- self._manager = null_backend.NullManager("", "")
+ self._manager = null_backend.NullBackend("", "")
@staticmethod
def name():
return "/".join(rturl.split(r"\/"))
-class RtMilkManager(object):
+class RtmBackend(object):
"""
Interface with rememberthemilk.com
@staticmethod
def _pack_ids(*ids):
"""
- >>> RtMilkManager._pack_ids(123, 456)
+ >>> RtmBackend._pack_ids(123, 456)
'123-456'
"""
return "-".join((str(id) for id in ids))
@staticmethod
def _unpack_ids(ids):
"""
- >>> RtMilkManager._unpack_ids("123-456")
+ >>> RtmBackend._unpack_ids("123-456")
['123', '456']
"""
return ids.split("-")
def get_credentials(credentialsDialog):
username, password = credentialsDialog.request_credentials()
- token = get_token(username, rtm_backend.RtMilkManager.API_KEY, rtm_backend.RtMilkManager.SECRET)
+ token = get_token(username, rtm_backend.RtmBackend.API_KEY, rtm_backend.RtmBackend.SECRET)
return username, password, token
credentials = self._credentials
while True:
try:
- self._manager = rtm_backend.RtMilkManager(*credentials)
+ self._manager = rtm_backend.RtmBackend(*credentials)
self._credentials = credentials
return # Login succeeded
except rtm_api.AuthStateMachine.NoData: