def __init__(self, *args, **kw): fuse.Fuse.__init__(self, *args, **kw) print "Fuse Init" # Set-Up Logger self.bcfslog = logging.getLogger(__name__) self.bcfslog.setLevel(logging.DEBUG) handler = logging.handlers.SysLogHandler( address='/dev/log', facility=logging.handlers.SysLogHandler.LOG_LOCAL6) formatter = logging.Formatter( 'Thead:%(thread)d(%(threadName)s) Function:%(module)s.%(funcName)s: %(message)s' ) handler.setFormatter(formatter) self.bcfslog.addHandler(handler) # Python FUSE Options self.bitcasa = Bitcasa('config.json', self.bcfslog) if (self.bitcasa == None): sys.exit("Failed to authenticate Bitcasa Client.") print "Authenticated fine" # Bitcasa Encoded Path (for things like rename/create/delete) self.bpath = "" # Breadcrumbs to how we got where we are. self.breadcrumbs = {} # Files/Folders in Current Path self.dir = {}
# Test Client for Bitcasa Python SDK from bitcasa import Bitcasa # Start Client client = Bitcasa('config.json') print("Bitcasa has been authorized with your account.") print("### Folder List (/) ###") folder_info = client.list_folder('/') folder_path = folder_info[0]['path'] print(folder_info) print(folder_path) print("### Adding Folder (to root)###") print(client.add_folder(folder_path, "Test"))