Skip to content

Commit f174207

Browse files
committed
Added line numbers in visualization.
1 parent 2fb4327 commit f174207

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

README.md

+8
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ pip install setuptools # If you have already installed this before, ignore it
2121
python setup.py install # Install pyjudge
2222
```
2323

24+
You can also build your Wheel package by executing the following command:
25+
26+
```sh
27+
pip install setuptools # If you have already installed this before, ignore it
28+
pip install wheel # Install bdist_wheel provider
29+
python setup.py build bdist_wheel # Build .whl package
30+
```
31+
2432
Alternatively you could download our official release from the releases panel,
2533
and install the compiled 'wheel' to your computer. After you have downloaded
2634
the release, you may install it in the command line:

pyjudge/visualize/__init__.py

+32
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,38 @@
7878
</div></div>
7979
% if test['display-output']:
8080
<div class="row">
81+
<%
82+
s_stdout = test['execution-status']['output']['stdout']
83+
s_userout = test['execution-status']['user-code']['stdout']
84+
s_stdin = test['execution-status']['input']['stdout']
85+
l_sout = s_stdout.split('\n')
86+
l_uout = s_userout.split('\n')
87+
l_sin = s_stdin.split('\n')
88+
n_out = []
89+
n_sout = []
90+
n_sin = []
91+
def make_line_count(i, ps_arr=None):
92+
maxlen = len(str(max(len(l_sout), len(l_uout))))
93+
if ps_arr:
94+
maxlen = len(str(len(ps_arr)))
95+
s = str(i).rjust(maxlen, ' ')
96+
return s
97+
for i in range(0, len(l_uout)):
98+
if i >= len(l_sout):
99+
n_out.append(make_line_count(i) + ' | ' + l_uout[i])
100+
continue
101+
n_sout.append(make_line_count(i) + ' | ' + l_sout[i])
102+
if l_uout[i] == l_sout[i]:
103+
n_out.append(make_line_count(i) + ' | ' + l_uout[i])
104+
else:
105+
n_out.append(make_line_count(i) + '###' + l_uout[i])
106+
pass
107+
for i in range(0, len(l_sin)):
108+
n_sin.append(make_line_count(i, ps_arr=l_sin) + ' | ' + l_sin[i])
109+
test['execution-status']['input']['stdout'] = '\n'.join(n_sin)
110+
test['execution-status']['user-code']['stdout'] = '\n'.join(n_out)
111+
test['execution-status']['output']['stdout'] = '\n'.join(n_sout)
112+
%>
81113
<div class="col-sm-4">
82114
<h4><b>Input</b></h4>
83115
<textarea style="font-family: Consolas; resize: none; width: 100%; height: 1000px;">${test['execution-status']['input']['stdout']}</textarea>

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def readme():
77

88
setup(
99
name = 'pyjudge',
10-
version = '0.1.74',
10+
version = '0.1.75',
1111
description = 'OI programs Judger in Python',
1212
long_description = 'Judge OI programs easily with pyJudge.',
1313
classifiers = [

0 commit comments

Comments
 (0)