Last active
August 29, 2015 14:20
-
-
Save cosenal/817ac522e2fd6ebe22a8 to your computer and use it in GitHub Desktop.
test osf's waterbutler owncloud provider
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
from waterbutler.providers.owncloud import OwnCloudProvider | |
loop = asyncio.get_event_loop() | |
creds = { | |
'owncloud': {'username': 'test', 'password': 'test'}, | |
} | |
settings = { | |
'owncloud': {'base_url': 'http://localhost/owncloud/'}, | |
} | |
owncloud = OwnCloudProvider({}, creds['owncloud'], settings['owncloud']) | |
print(loop.run_until_complete(owncloud.metadata('/myfile.txt'))) | |
print(loop.run_until_complete(loop.run_until_complete(owncloud.download('/myfile.txt')).read())) | |
print(loop.run_until_complete(owncloud.upload(streams.StringStream('This will be the contents of newfile.txt'), | |
'/newfile.txt'))) | |
print(loop.run_until_complete(owncloud.delete('/newfile.txt'))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment