Skip to content

Commit

Permalink
Support more regions (#19)
Browse files Browse the repository at this point in the history
* suppport singapore region
  • Loading branch information
liuchang0812 authored Nov 30, 2016
1 parent 4efd746 commit 8e0e7f9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CHANGES
+++++++++

* 0.0.9 add new region: spg
* 0.0.8 fix bug
* 0.0.7 update documents
* 0.0.6 add tj region, enable_https changes to False
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ __________
appid = 100000 # 替换为用户的appid
secret_id = u'xxxxxxxx' # 替换为用户的secret_id
secret_key = u'xxxxxxx' # 替换为用户的secret_key
   region_info = "sh" #           # 替换为用户的region,目前可以为 sh/gz/tj,分别对应于上海,广州,天津园区
  region_info = "sh" #           # 替换为用户的region,目前可以为 sh/gz/tj/sgp,分别对应于上海,广州,天津,新加坡园区
cos_client = CosClient(appid, secret_id, secret_key, region=region_info)
# 设置要操作的bucket
Expand Down
4 changes: 4 additions & 0 deletions qcloud_cos/cos_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def __init__(self, region=None, hostname=None, download_hostname=None, *args, **
self._hostname = 'tj.file.myqcloud.com'
self._download_hostname = 'costj.myqcloud.com'

elif region in ['sgp', 'singapore']:
self._hostname = 'sgp.file.myqcloud.com'
self._download_hostname = 'cosspg.myqcloud.com'

else:
if hostname and download_hostname:
self._hostname = hostname
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
sys.exit('Sorry, only python 2.6 or 2.7 is supported')

setup(name='qcloud_cos_v4',
version='0.0.8',
version='0.0.9',
description='python sdk for tencent qcloud cos v4.0',
long_description=open('README.rst', 'r').read(),
license='MIT License',
Expand Down

0 comments on commit 8e0e7f9

Please sign in to comment.