Skip to content

Commit

Permalink
use pycodestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
tiedu committed Nov 20, 2018
1 parent efe832c commit a946204
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ install:
- pip install requests
- pip install six
- pip install nose
- pip install pep8
- pip install pycodestyle
- pip install dicttoxml
script:
- pep8 --max-line-length=180 qcloud_cos/.
- pycodestyle --max-line-length=180 qcloud_cos/.
- nosetests -s -v ut/
deploy:
provider: pypi
Expand Down
4 changes: 2 additions & 2 deletions qcloud_cos/cos_comm.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def format_region(region):
if not region:
raise CosClientError("region is required not empty!")
region = to_unicode(region)
if not re.match('^[A-Za-z0-9][A-Za-z0-9.\-]*[A-Za-z0-9]$', region):
if not re.match(r'^[A-Za-z0-9][A-Za-z0-9.\-]*[A-Za-z0-9]$', region):
raise CosClientError("region format is illegal, only digit, letter and - is allowed!")
if region.find(u'cos.') != -1:
return region # 传入cos.ap-beijing-1这样显示加上cos.的region
Expand Down Expand Up @@ -260,7 +260,7 @@ def format_bucket(bucket, appid):
raise CosClientError("bucket is not string")
if not bucket:
raise CosClientError("bucket is required not empty")
if not (re.match('^[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]$', bucket) or re.match('^[A-Za-z0-9]$', bucket)):
if not (re.match(r'^[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9]$', bucket) or re.match('^[A-Za-z0-9]$', bucket)):
raise CosClientError("bucket format is illegal, only digit, letter and - is allowed!")
# appid为空直接返回bucket
if not appid:
Expand Down

0 comments on commit a946204

Please sign in to comment.