Skip to content

Commit

Permalink
Fix error in upload progress updating (houtianze#260); Add in aria2 d…
Browse files Browse the repository at this point in the history
…ownloading retry (houtianze#263)
  • Loading branch information
houtianze committed Jun 13, 2016
1 parent 2406463 commit 76037cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
### Version History:

- 1.2.20: Fix an error in upload resuming; Add in retries for aria2
- 1.2.19: Add in aria2 download support
- 1.2.18: Add in upload resuming using slices; Fix Unicode issue with py2_jsondump(); Fix the pypi setup package
- 1.2.17: Fix UnicodeEncodeError on redirect; Add in retry on urllib3 TimeOutError
Expand Down
8 changes: 5 additions & 3 deletions bypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
from __future__ import division

### special variables that say about this module
__version__ = '1.2.19'
__version__ = '1.2.20'

### return (error) codes
# they are put at the top because:
Expand Down Expand Up @@ -2366,7 +2366,7 @@ def __update_progress_entry(self, fullpath):

def __delete_progress_entry(self, fullpath):
progress = jsonload(ProgressPath)
progress.remove(fullpath)
del progress[fullpath]
jsondump(progress, ProgressPath)

def __upload_file_slices(self, localpath, remotepath, ondup = 'overwrite'):
Expand Down Expand Up @@ -2820,7 +2820,9 @@ def __down_aria2c(self, remotefile, localfile):
self.pd("call: {}".format(cmd))
ret = subprocess.call(cmd, shell = True)
self.pd("aria2c exited with status: {}".format(ret))
# TODO: map return codes to our internal errors
# TODO: a finer map return codes to our internal errors
if ret != ENoError:
ret == ERequestFailed
return ret

# requirment: self.__remote_json is already gotten
Expand Down

0 comments on commit 76037cd

Please sign in to comment.