diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-11-09 08:37:53 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2014-11-09 08:37:53 +0100 |
commit | 2ea470dfc61e054f477d08698b00f0a911b68cd5 (patch) | |
tree | 21f9442fb1346293cf69abda47aa685babd77c2e /fetch.py | |
parent | Class btn-default for the 'Log In' button. (diff) | |
download | newspipe-2ea470dfc61e054f477d08698b00f0a911b68cd5.tar.gz newspipe-2ea470dfc61e054f477d08698b00f0a911b68cd5.tar.bz2 newspipe-2ea470dfc61e054f477d08698b00f0a911b68cd5.zip |
More robust fetch.py script.
Diffstat (limited to 'fetch.py')
-rwxr-xr-x | fetch.py | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -13,16 +13,19 @@ from pyaggr3g470r.models import User if __name__ == "__main__": # Point of entry in execution mode + users, feed_id = [], None try: - feed_id = int(sys.argv[2]) + users = User.query.filter(User.id == int(sys.argv[1])).all() except: - feed_id = None + users = User.query.all() + finally: + if users == []: + users = User.query.all() - users = [] try: - users = User.query.filter(User.email == sys.argv[1]).all() + feed_id = int(sys.argv[2]) except: - users = User.query.all() + feed_id = None for user in users: if user.activation_key == "": |