Skip to content

Commit

Permalink
增加对连续数据的支持
Browse files Browse the repository at this point in the history
  • Loading branch information
maplebeats committed Aug 29, 2012
1 parent dadbe64 commit 7b03d72
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions xfdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,10 @@ def __getdownload(self):
if target.upper()=="A":
lists=zip(range(1,len(self.filehash)+1) , ['']* len(self.filehash))
elif '-' in target:
ran = target.split('-')
nums = range(int(ran[0]),int(ran[1])+1)
nums = []
for i in target.split(' '):
ran = i.split('-')
nums.extend(range(int(ran[0]),int(ran[1])+1))
lists = zip(nums , [''] * len(nums))
else:
lists=self.__RE.findall(target)
Expand All @@ -308,8 +310,10 @@ def __deltask(self):
if target.upper()=="A":
lists=zip(range(1,len(self.filehash)+1) , ['']* len(self.filehash))
elif '-' in target:
ran = target.split('-')
nums = range(int(ran[0]),int(ran[1])+1)
nums = []
for i in target.split():
ran = target.split('-')
nums.extend(range(int(ran[0]),int(ran[1])+1))
lists = zip(nums , [''] * len(nums))
else:
lists=self.__RE.findall(target)
Expand Down

0 comments on commit 7b03d72

Please sign in to comment.