Skip to content

Commit

Permalink
Merge pull request #53 from fukatani/quick-fix
Browse files Browse the repository at this point in the history
quick-fix
  • Loading branch information
fukatani authored Jul 26, 2020
2 parents f0dac96 + 7d1a528 commit ebb8667
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 29 deletions.
55 changes: 28 additions & 27 deletions rujaion/custom_popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,34 @@ def __init__(self, url: str):
self.url = url

def run(self):
finished = False
with with_cookiejar(
new_session_with_our_user_agent(), path=default_cookie_path
) as sess:
for i in range(40):
time.sleep(2)
submission = submission_from_url(self.url)
result = submission.download_data(session=sess)
self.updateRequest.emit((result.status, result.problem_id))
result = result.status
failed = any([word in result for word in self.failed_words])
if result == "AC" or failed:
finished = True
if failed:
subprocess.check_call(
["sensible-browser", submission.get_url()],
stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr,
)
finished = True
if finished:
time.sleep(3)
self.finishRequest.emit()
break
time.sleep(3)
self.finishRequest.emit()
try:
with with_cookiejar(
new_session_with_our_user_agent(), path=default_cookie_path
) as sess:
finished = False
for i in range(40):
time.sleep(2)
submission = submission_from_url(self.url)
result = submission.download_data(session=sess)
self.updateRequest.emit((result.status, result.problem_id))
result = result.status
failed = any([word in result for word in self.failed_words])
if result == "AC" or failed:
finished = True
if failed:
subprocess.check_call(
["sensible-browser", submission.get_url()],
stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr,
)
finished = True
if finished:
break
except Exception as e:
print(e)
time.sleep(3)
self.finishRequest.emit()


class CustomPopup(QtWidgets.QWidget):
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def load_module(module_path):

setup(
name="Rujaion",
version="0.11.0",
version="0.11.1",
author="Ryosuke Fukatani",
install_requires=[
"PyQt5",
"PyQtWebEngine",
"pexpect",
"online-judge-tools >= 7.3.0",
"online-judge-tools == 9.2.2",
"pandas",
],
packages=find_packages(exclude=("docker", "doc")),
Expand Down

0 comments on commit ebb8667

Please sign in to comment.