Created
November 16, 2017 07:25
-
-
Save gzxultra/c0c817367a19672d70bf9b3b7180cc2b to your computer and use it in GitHub Desktop.
examples using progress bar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```python | |
from ec.broker.user_persona import update_user_persona | |
from mysite.model.user import User | |
from mysite.model.const.user import STATE_ACTIVE | |
from mysite.util.orm import ormiter | |
from progress.bar import Bar | |
if __name__ == '__main__': | |
bar = Bar('Processing', max=User.where().count(), suffix='%(percent).1f%% - %(eta)ds') | |
for user in ormiter(User, where='state>=%s' % STATE_ACTIVE): | |
update_user_persona(user.id) | |
bar.next() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment