Skip to content

Commit a946204

Browse files
author
tiedu
committed
use pycodestyle
1 parent efe832c commit a946204

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ install:
99
- pip install requests
1010
- pip install six
1111
- pip install nose
12-
- pip install pep8
12+
- pip install pycodestyle
1313
- pip install dicttoxml
1414
script:
15-
- pep8 --max-line-length=180 qcloud_cos/.
15+
- pycodestyle --max-line-length=180 qcloud_cos/.
1616
- nosetests -s -v ut/
1717
deploy:
1818
provider: pypi

qcloud_cos/cos_comm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ def format_region(region):
225225
if not region:
226226
raise CosClientError("region is required not empty!")
227227
region = to_unicode(region)
228-
if not re.match('^[A-Za-z0-9][A-Za-z0-9.\-]*[A-Za-z0-9]$', region):
228+
if not re.match(r'^[A-Za-z0-9][A-Za-z0-9.\-]*[A-Za-z0-9]$', region):
229229
raise CosClientError("region format is illegal, only digit, letter and - is allowed!")
230230
if region.find(u'cos.') != -1:
231231
return region # 传入cos.ap-beijing-1这样显示加上cos.的region
@@ -260,7 +260,7 @@ def format_bucket(bucket, appid):
260260
raise CosClientError("bucket is not string")
261261
if not bucket:
262262
raise CosClientError("bucket is required not empty")
263-
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)):
263+
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)):
264264
raise CosClientError("bucket format is illegal, only digit, letter and - is allowed!")
265265
# appid为空直接返回bucket
266266
if not appid:

0 commit comments

Comments
 (0)