-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #181:Introduce pretty print and pager output for challenges #197
Changes from 2 commits
5fabd6d
4184fa5
07a7309
35aaa41
f164cf6
01dd808
7a8fba4
c93df7f
17f1573
ace5eda
5d7817b
876ca16
c5c7358
8360b33
c91ac2d
f1a138b
94cd77d
2792729
f253581
814ecfe
f28c567
53613ef
9a32a59
41d8b11
0ca7510
67eb9c3
4007d16
e7d5556
f12a086
1ca6ff4
c771e65
e72fd1e
18caa2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
import json | ||
import requests | ||
import sys | ||
|
||
from termcolor import colored | ||
from bs4 import BeautifulSoup | ||
from beautifultable import BeautifulTable | ||
from click import echo, style | ||
from click import echo, style, echo_via_pager | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok I have moved it to the end and changed style and eco_via_pager |
||
from datetime import datetime | ||
|
||
from evalai.utils.auth import get_request_header, get_host_url | ||
|
@@ -38,12 +38,20 @@ def pretty_print_challenge_data(challenges): | |
table.column_headers = columns_attributes | ||
for challenge in reversed(challenges): | ||
values = list(map(lambda item: challenge[item], attributes)) | ||
values1=str(values) | ||
creator = challenge["creator"]["team_name"] | ||
start_date = convert_UTC_date_to_local(challenge["start_date"]) | ||
end_date = convert_UTC_date_to_local(challenge["end_date"]) | ||
values.extend([creator, start_date, end_date]) | ||
table.append_row(values) | ||
echo(table) | ||
table.append_row([colored(values[0],'white'), | ||
colored(values[1], 'yellow'), | ||
colored(values[2], 'cyan'), | ||
colored(values[3], 'white'), | ||
colored(values[4], 'green'), | ||
colored(values[5], 'red') | ||
]) | ||
|
||
echo_via_pager(table,color='yes') | ||
|
||
|
||
def display_challenges(url): | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,21 @@ | ||
beautifulsoup4==4.7.1 | ||
beautifultable==0.7.0 | ||
boto==2.49.0 | ||
boto3==1.9.88 | ||
botocore==1.12.116 | ||
click==6.7 | ||
coverage==4.5.1 | ||
coveralls==1.3.0 | ||
docker==3.6.0 | ||
flake8==3.0.4 | ||
lxml==4.2.1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @RohanSreelesh Why is lxml removed as a dependency in this commit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My build wasnt installing , then @yashdusing on gitter suggested removing this from requirements and setup.py after which I was able to install it successfully There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some development libraries are missing in the python package related to lxml, thus the package was not installing. You can find more details here. We cannot remove it from the requirements as it would break some other parts of the code(for example, the build fails as the lmxl based tests are not passing). The issue exists on windows due to the version of lxml (please refer to the second answer on the link about. maybe you could update the version of lxml in requirements.txt and try reinstalling on windows to resolve the issue.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand , I had done the solutions given in the link including the second answer but the build still didnt work for me unfortunately. I'll add it back There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added lxml back into requirements and setup.py but the build is still failing @pushkalkatara There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The build is failing due to some more issues. You can get all the details here.
|
||
pre-commit==1.14.4 | ||
pytest==3.5.1 | ||
pytest-cov==2.5.1 | ||
python-dateutil==2.7.3 | ||
requests==2.20.0 | ||
requests-toolbelt==0.8.0 | ||
responses==0.9.0 | ||
validators==0.12.2 | ||
beautifulsoup4==4.7.1 | ||
beautifultable==0.7.0 | ||
boto==2.49.0 | ||
boto3==1.9.88 | ||
botocore==1.12.116 | ||
click==6.7 | ||
coverage==4.5.1 | ||
coveralls==1.3.0 | ||
docker==3.6.0 | ||
flake8==3.0.4 | ||
|
||
pre-commit==1.14.4 | ||
pytest==3.5.1 | ||
pytest-cov==2.5.1 | ||
python-dateutil==2.7.3 | ||
requests==2.20.0 | ||
requests-toolbelt==0.8.0 | ||
responses==0.9.0 | ||
validators==0.12.2 | ||
termcolor==1.1.0 | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this extra line. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RohanSreelesh please move this to last import after
datetime
. We follow alphabetical order for imports