Nicer syntax for resumable_iteration usage

This commit is contained in:
Alexander Graf
2020-08-02 10:22:45 +02:00
parent c71873231d
commit a8d3851956
2 changed files with 6 additions and 8 deletions
+1 -2
View File
@@ -219,8 +219,7 @@ def resumable_iteration(context: InstaloaderContext,
load=lambda _, path: FrozenNodeIterator(**json.load(open(path))),
save=lambda fni, path: json.dump(fni._asdict(), open(path, 'w')),
format_path=lambda magic: "resume_info_{}.json".format(magic)
) as resume_info:
is_resuming, start_index = resume_info
) as (is_resuming, start_index):
for post in post_iterator:
do_something_with(post)