Skip to content

Commit

Permalink
user defined: QBOX_ACCESS_KEY, QBOX_SECRET_KEY
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Jun 27, 2012
1 parent d5436ba commit 57a5644
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 68 deletions.
24 changes: 0 additions & 24 deletions qbox/config.dev.py

This file was deleted.

24 changes: 0 additions & 24 deletions qbox/config.local.py

This file was deleted.

9 changes: 2 additions & 7 deletions qbox/config.pro.py
@@ -1,8 +1,8 @@
#
# OAuth2

ACCESS_KEY ="Please apply your access key"
SECRET_KEY ="Dont send your secret key to anyone"
ACCESS_KEY = '<Please apply your access key>'
SECRET_KEY = '<Dont send your secret key to anyone>'

REDIRECT_URI = '<RedirectURL>'
AUTHORIZATION_ENDPOINT = '<AuthURL>'
Expand All @@ -17,8 +17,3 @@
FS_HOST = 'https://fs.qbox.me'
RS_HOST = 'http://rs.qbox.me:10100'

#
# Demo

DEMO_DOMAIN = 'iovip.qbox.me'

2 changes: 0 additions & 2 deletions qbox/rs.py
@@ -1,8 +1,6 @@
#coding=utf8

import config
import simpleoauth2
import digestoauth
from base64 import urlsafe_b64encode

class Service:
Expand Down
20 changes: 9 additions & 11 deletions qbox/rs_demo.py
@@ -1,12 +1,16 @@
#!/usr/bin/env python

import urllib
import simpleoauth2
import digestoauth
import rs as qboxrs
import rscli
import config

config.ACCESS_KEY = '<Please apply your access key>'
config.SECRET_KEY = '<Dont send your secret key to anyone>'

DEMO_DOMAIN = 'iovip.qbox.me/bucket'

client = digestoauth.Client()

bucket = 'bucket'
Expand All @@ -26,7 +30,7 @@
print '\n===> PutFile %s result:' % key
print resp

resp = rs.Publish(config.DEMO_DOMAIN + '/' + bucket)
resp = rs.Publish(DEMO_DOMAIN)
print '\n===> Publish result:'
print resp

Expand All @@ -45,13 +49,7 @@
print '\n===> Display %s contents:' % key
print urllib.urlopen(resp['url']).read()

action=''
if action == 'delete':
resp = rs.Delete(key)
print '\n===> Delete %s result:' % key
print resp
elif action == 'drop':
resp = rs.Drop()
print '\n===> Drop table result:'
print resp
resp = rs.Delete(key)
print '\n===> Delete %s result:' % key
print resp

0 comments on commit 57a5644

Please sign in to comment.