jamesmeneghello / pynab

Newznab-compliant Usenet Indexer written in Python, using PostgreSQL/MySQL-like.
Other
209 stars 44 forks source link

Updating single group breaks code #270

Closed randallfox closed 7 years ago

randallfox commented 8 years ago

If you enter a command line of: python3 scan.py update

The code breaks on scan.py line 139. The reason, the variable "active_groups" is assumed to be a dictionary, and it is when the name of the group is pulled from the db, but when you supply it from the command line, it is a list. Thus, the call to "active_groups.keys()" fails and kills the app.

The following is the code with some surrounding context:

if mode == 'backfill':
    result = [executor.submit(backfill, active_group, date, target) for active_group, target in active_groups.items()]
else:
    ###################################################
    # THE FOLLOWING IS THE PROBLEM LINE
    result = [executor.submit(update, active_group) for active_group in active_groups.keys()]
    ###################################################
    for r in concurrent.futures.as_completed(result):
        data.append(r.result())
brookesy2 commented 8 years ago

Chuck in a PR if you can, I'm sure @Murodese will merge it in :)