Skip to content

Commit

Permalink
version 1.0.3 && fix old samples format parse
Browse files Browse the repository at this point in the history
  • Loading branch information
bacali95 committed Feb 8, 2019
1 parent 554d152 commit e536bb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cf_submit/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.0.2'
__version__ = '1.0.3'
8 changes: 6 additions & 2 deletions cf_submit/cf_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ def parse(group, contest, problem):
inputs = sample_test.find_all("div", class_="input")
for i in inputs:
input_text = i.find("pre")
create_file(str(input_text.text).strip(), "test%d.in" % (j))
input_text = str(input_text).replace(
'<br/>', '\n').replace('<pre>', '').replace('</pre>', '')
create_file(input_text.strip(), "test%d.in" % (j))
j += 1
outputs = sample_test.find_all("div", class_="output")
j = 0
for i in outputs:
output_text = i.find("pre")
create_file(str(output_text.text).strip(), "test%d.ans" % (j))
output_text = str(output_text).replace(
'<br/>', '\n').replace('<pre>', '').replace('</pre>', '')
create_file(output_text.strip(), "test%d.ans" % (j))
j += 1
except Exception:
print("%sError, try in few minutes!!%s" %
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def run(self):

setup(
name="cf_submit",
version="1.0.2",
version="1.0.3",
scripts=['cf'],
author="Nasreddine Bac Ali",
author_email="[email protected]",
Expand Down

0 comments on commit e536bb1

Please sign in to comment.