File tree 1 file changed +7
-8
lines changed
1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -40,18 +40,17 @@ class InputURLTask(ItemTask[AppSession]):
40
40
@asyncio .coroutine
41
41
def process (self , session : AppSession ):
42
42
url_table = session .factory ['URLTable' ]
43
+ url_count = 0
43
44
44
45
for batch in wpull .util .grouper (self ._read_input_urls (session ), 1000 ):
45
- url_table .add_many (AddURLInfo (url_info .url , None , None ) for url_info in batch if url_info )
46
+ urls = url_table .add_many (AddURLInfo (url_info .url , None , None ) for url_info in batch if url_info )
46
47
# TODO: attach hook for notifying progress
48
+ url_count += len (urls )
47
49
48
- # TODO: raise on error if no urls
49
- # urls = (line.strip() for line in input_file if line.strip())
50
- #
51
- # if not urls:
52
- # raise ValueError(_('No URLs found in input file.'))
53
- #
54
- # return urls
50
+ # TODO: check if database is empty
51
+ # TODO: add a test for this
52
+ # if not url_count:
53
+ # raise ValueError(_('No URLs found in input file.'))
55
54
56
55
@classmethod
57
56
def _read_input_urls (cls , session : AppSession , default_scheme = 'http' ):
You can’t perform that action at this time.
0 commit comments