Permalink
Browse files

user defined: QBOX_ACCESS_KEY, QBOX_SECRET_KEY

  • Loading branch information...
1 parent d5436ba commit 57a5644fc0f7b4eac0e19173edf0f9b23443ca84 @xushiwei xushiwei committed Jun 27, 2012
Showing with 11 additions and 68 deletions.
  1. +0 −24 qbox/config.dev.py
  2. +0 −24 qbox/config.local.py
  3. +2 −7 qbox/config.pro.py
  4. +0 −2 qbox/rs.py
  5. +9 −11 qbox/rs_demo.py
View
@@ -1,24 +0,0 @@
-#
-# OAuth2
-
-ACCESS_KEY ="Please apply your access key"
-SECRET_KEY ="Dont send your secret key to anyone"
-
-REDIRECT_URI = '<RedirectURL>'
-AUTHORIZATION_ENDPOINT = '<AuthURL>'
-TOKEN_ENDPOINT = 'http://dev.qbox.us:9100/oauth2/token'
-
-#
-# QBox
-
-PUT_TIMEOUT = 300000 # 300s = 5m
-
-IO_HOST = 'http://dev.qbox.us:9200'
-FS_HOST = 'http://dev.qbox.us:9300'
-RS_HOST = 'http://dev.qbox.us:10100'
-
-#
-# Demo
-
-DEMO_DOMAIN = 'dev.qbox.us:9200'
-
View
@@ -1,24 +0,0 @@
-#
-# OAuth2
-
-ACCESS_KEY ="Please apply your access key"
-SECRET_KEY ="Dont send your secret key to anyone"
-
-REDIRECT_URI = '<RedirectURL>'
-AUTHORIZATION_ENDPOINT = '<AuthURL>'
-TOKEN_ENDPOINT = 'http://127.0.0.1:9876/oauth2/token'
-
-#
-# QBox
-
-PUT_TIMEOUT = 300000 # 300s = 5m
-
-IO_HOST = 'http://127.0.0.1:9876'
-FS_HOST = 'http://127.0.0.1:9872'
-RS_HOST = 'http://127.0.0.1:9875'
-
-#
-# Demo
-
-DEMO_DOMAIN = 'localhost:9876'
-
View
@@ -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>'
@@ -17,8 +17,3 @@
FS_HOST = 'https://fs.qbox.me'
RS_HOST = 'http://rs.qbox.me:10100'
-#
-# Demo
-
-DEMO_DOMAIN = 'iovip.qbox.me'
-
View
@@ -1,8 +1,6 @@
#coding=utf8
import config
-import simpleoauth2
-import digestoauth
from base64 import urlsafe_b64encode
class Service:
View
@@ -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'
@@ -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
@@ -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.