xbmcbackup/resources/lib/vfs.py

46 lines
962 B
Python
Raw Normal View History

import utils as utils
2012-11-02 21:59:40 +01:00
import xbmcvfs
from dropbox import client, rest, session
APP_KEY = 'f5wlmek6aoriqax'
APP_SECRET = 'b1461sje1kxgzet'
class Vfs:
type = 'none'
def listdir(directory):
return {}
def mkdir(directory):
return True
def copy(source,dest):
return True
2012-11-02 21:59:40 +01:00
def rmdir(directory):
return True
def exists(aFile):
return True
2012-11-02 21:59:40 +01:00
class XBMCFileSystem(Vfs):
self.root_path
def listdir(directory):
return xbmcvfs.listdir(directory)
def mkdir(directory):
return xbmcvfs.mkdir(directory)
def rmdir(directory):
return xbmcvfs.rmdir(directory,True)
def exists(aFile):
return xbmcvfs.exists(aFile)
class DropboxFilesystem(Vfs):
def __init__(self):
session = session.DropboxSession(APP_KEY,APP_SECRET,"app_folder")
token = session.obtain_request_token()
access_token = session.obtain_access_token(token)