test of dropbox import

This commit is contained in:
robweber 2012-10-22 15:02:30 -05:00
parent 1321e244a7
commit 4749978adb

View File

@ -1,10 +1,14 @@
import xbmc import xbmc
import xbmcgui import xbmcgui
import xbmcvfs import xbmcvfs
from resources.dropbox import client, rest, session
import utils as utils import utils as utils
import os import os
import time import time
APP_KEY = 'f5wlmek6aoriqax'
APP_SECRET = 'b1461sje1kxgzet'
class FileManager: class FileManager:
walk_path = '' walk_path = ''
fileArray = None fileArray = None
@ -127,7 +131,13 @@ class XbmcBackup:
#append backup folder name #append backup folder name
if(mode == self.Backup and self.remote_root != ''): if(mode == self.Backup and self.remote_root != ''):
self.remote_path = self.remote_root + time.strftime("%Y%m%d") + "/" #check here if we're using Dropbox or not
if(utils.getSetting('remote_selection') == 2):
session = session.DropboxSession(APP_KEY,APP_SECRET,"app_folder")
token = session.obtain_request_token()
access_token = session.obtain_access_token(token)
else:
self.remote_path = self.remote_root + time.strftime("%Y%m%d") + "/"
elif(mode == self.Restore and utils.getSetting("backup_name") != '' and self.remote_root != ''): elif(mode == self.Restore and utils.getSetting("backup_name") != '' and self.remote_root != ''):
self.remote_path = self.remote_root + utils.getSetting("backup_name") + "/" self.remote_path = self.remote_root + utils.getSetting("backup_name") + "/"
else: else: