Skip to content

Commit

Permalink
enhance cup.obj and add pypi script
Browse files Browse the repository at this point in the history
enhance cup.obj and add pypi script
  • Loading branch information
mythmgn committed Jun 6, 2019
1 parent c433816 commit db034f9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -120,3 +120,4 @@ docs/zh-hans/senarios/temp.md
test.json
百度开源社区专访稿(马冠南).docx
docs/_book.zip
cup_bidu
6 changes: 4 additions & 2 deletions cup/storage/obj.py
Expand Up @@ -622,9 +622,11 @@ def get(self, path, localpath):
ftp_cmd = 'RETR {0}'.format(path)
resp = self._ftp_con.retrbinary(ftp_cmd, fhandle.write)
except Exception as error:
log.error(traceback.format_exc())
ret['returncode'] = -1
ret['msg'] = str(error)
ret['msg'] = 'failed to get {0} to {1}, err:{2}'.format(
path, localpath, error
)
log.error(ret['msg'])
return ret

def head(self, path):
Expand Down
12 changes: 12 additions & 0 deletions upload_pypi.sh
@@ -0,0 +1,12 @@
#!/bin/bash
# ##########################################################################
# Author: Guannan Ma
# Brief: Upload cup to pypi
#
# Returns:
# succ: 0
# fail: not 0
# ##########################################################################
rm -rf ./build ./cup.egg-info ./dist
python setup.py bdist_wheel
twine upload dist/*

0 comments on commit db034f9

Please sign in to comment.