Example #1
0
	def setup(self):
		"""Retrieves all startup data and creates a new DropboxClient with it"""

		(access_key, access_secret) = dropbox_access.get_access_token()
		self.session = DropboxSession(DROPBOX_APP_KEY, DROPBOX_APP_SECRET, DROPBOX_ACCESS_TYPE)
		self.session.obtain_request_token()
		self.session.set_token(access_key, access_secret)
		self.client = DropboxClient(self.session)
		self.is_setup = True
Example #2
0
def get_detailed_status():
	"""Retrieves detailed status data for multiple tables."""

	status = system_status.retrieve_status()
	config = user_config.get_current_config()

	if status.latest_sync == 0:
		next_sync = __("Waiting for first sync")
	else:
		next_sync = status.latest_sync + (config.image_download_wait * 60)
		next_sync = cutetime(next_sync)

	access_token = dropbox_access.get_access_token()

	if user_account.is_logged_in() is False or access_token == (None, None):
		next_sync = __("Dropbox connection needed")

	return {
		"latest_sync" : status.latest_sync,
		"total_images_saved" : dropbox_images.get_amount(),
		"uptime" : status.uptime_start,
		"next_sync" : next_sync,
		"background_job" : JobEnum.value_repr(status.current_background_job)
	}