Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Alan Marchiori
labtool
Commits
ff4b80a6
Commit
ff4b80a6
authored
Apr 22, 2020
by
Alan Marchiori
Browse files
increased timeout
parent
2912c0ca
Changes
4
Hide whitespace changes
Inline
Side-by-side
commands/checker.py
View file @
ff4b80a6
...
...
@@ -97,8 +97,8 @@ class Checker:
error
(
"Locate specified but no \{ \} in command! Check rubric!"
)
if
to
>
3
:
warn
(
"Running
{}
with timeout {}s, please wait!"
.
format
(
cmd
,
to
warn
(
"Running
command
with timeout {}s, please wait!"
.
format
(
to
))
if
'remote'
in
check
and
'depends'
in
check
:
...
...
@@ -148,7 +148,7 @@ class Checker:
lab_relative_path
,
cmd
)
print
(
"Remote exec: {}"
.
format
(
cmd
))
debug
(
"Remote exec: {}"
.
format
(
cmd
))
c
,
t
=
run
(
cmd
,
shell
=
False
,
input
=
instr
,
timeout
=
to
)
else
:
# locally execute
...
...
commands/grade.py
View file @
ff4b80a6
...
...
@@ -32,9 +32,11 @@ import contextlib # to redirect stdout
help
=
'Regrade a previously graded item?
\t
[default: False]'
)
@
click
.
option
(
"--user"
,
default
=
None
,
help
=
'Set to only grade a single user (by git username).
\t
[default: ALL]'
)
@
click
.
option
(
"--skip"
,
default
=
None
,
help
=
'Skip the given user or list of users (comma separated)
\t
[default: None]'
)
@
click
.
option
(
"--push/--no-push"
,
default
=
True
,
show_default
=
True
,
help
=
'Push commits to gitlab?'
)
def
grade
(
lab
,
part
,
clone
,
dograde
,
regrade
,
user
,
push
):
def
grade
(
lab
,
part
,
clone
,
dograde
,
regrade
,
user
,
skip
,
push
):
"""grade LAB and PART for students from gitlab. LAB is required. If PART is omitted, ALL parts are graded.
"""
...
...
@@ -70,7 +72,7 @@ def grade(lab, part, clone, dograde, regrade, user, push):
echo
(
msg
)
rubric
=
courses
.
load_rubric
(
coursename
,
labname
)
if
not
rubric
:
error
(
"{} is not defined for the course {}.)"
.
format
(
labname
,
coursename
...
...
@@ -96,6 +98,12 @@ def grade(lab, part, clone, dograde, regrade, user, push):
str
(
list
(
p
[
'name_with_namespace'
]
for
p
in
projects
))))
return
if
skip
:
# allow comma separated lists
if
','
in
skip
:
skip
=
list
(
map
(
str
.
strip
,
skip
.
split
(
','
)))
else
:
skip
=
[
skip
.
strip
()]
for
p
in
projects
:
pname
=
p
[
'name_with_namespace'
]
...
...
@@ -104,6 +112,9 @@ def grade(lab, part, clone, dograde, regrade, user, push):
if
user
and
student
!=
user
:
continue
if
skip
and
student
in
skip
:
warn
(
"Skipping user {}."
.
format
(
student
))
continue
echo
(
"-"
*
(
width
-
4
))
echo
(
"[{}] {} ({})"
.
format
(
'./'
+
student
,
pname
,
student
))
...
...
lt.py
View file @
ff4b80a6
...
...
@@ -36,7 +36,7 @@ smtp_handler = logging.handlers.SMTPHandler(
subject
=
u
"labtool crash report!"
)
__version__
=
'1.0.10'
__date__
=
'2020-0
2
-1
7
T1
2:42:31.300983
'
__date__
=
'2020-0
4
-1
2
T1
5:39:19.329244
'
__user__
=
'cs206'
__host__
=
'linuxremote3.bucknell.edu'
@
click
.
group
()
...
...
utils/git.py
View file @
ff4b80a6
...
...
@@ -80,7 +80,7 @@ class Git:
# assume the repo has been cloned, just pull it
cmd
=
"git pull"
echo
(
"Pulling {}... "
.
format
(
localpath
))
c
,
r
=
shell
.
run
(
cmd
,
cwd
=
localpath
)
c
,
r
=
shell
.
run
(
cmd
,
cwd
=
localpath
,
timeout
=
45
)
if
c
!=
0
:
error
(
'[{}]$ {}'
.
format
(
localpath
,
cmd
))
error
(
r
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment