Skip to content

Commit

Permalink
Terminal Capsule Pull Out and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
minhoryang committed Mar 14, 2016
1 parent 0673b6c commit ec498a3
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 27 deletions.
Binary file removed OnlineJudgeServer/.terminal_capsule.py.swp
Binary file not shown.
27 changes: 0 additions & 27 deletions OnlineJudgeServer/terminal_capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,30 +312,3 @@ def _GOT_STDOUT():
break
except Capsule.DEAD as dying_message:
_FAIL()


if __name__ == "__main__":
from click import (
argument,
command,
option,
Choice,
File,
Path,
)

@command()
@argument('program', type=Path())
@option('-m', '--mode',
'mode', type=Choice(_Registered.keys()), default='capture')
@option('-j', '--json', type=Path(), default=None,
help='Generate .json (or playback/validate)')
@option('-o', '--out', type=File('wb'), default=None,
help='Generate .out (or logging)')
@option('-t', '--timeout', type=int, default=None,
help='Set timeout (default: .05s, validate: 2.5s)')
def __main__(program, mode, json, out, timeout):
"""Entrypoint for Terminal Capsule."""
_Registered[mode](program, json, out, timeout=timeout)

__main__()
28 changes: 28 additions & 0 deletions terminal_capsule.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from OnlineJudgeServer.terminal_capsule import _Registered


if __name__ == "__main__":
from click import (
argument,
command,
option,
Choice,
File,
Path,
)

@command()
@argument('program', type=Path())
@option('-m', '--mode',
'mode', type=Choice(_Registered.keys()), default='capture')
@option('-j', '--json', type=Path(), default=None,
help='Generate .json (or playback/validate)')
@option('-o', '--out', type=File('wb'), default=None,
help='Generate .out (or logging)')
@option('-t', '--timeout', type=int, default=None,
help='Set timeout (default: .05s, validate: 2.5s)')
def __main__(program, mode, json, out, timeout):
"""Entrypoint for Terminal Capsule."""
_Registered[mode](program, json, out, timeout=timeout)

__main__()

0 comments on commit ec498a3

Please sign in to comment.