Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
exam-print-script
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
A-SAM
exam-print-script
Commits
0fae3583
Commit
0fae3583
authored
Aug 28, 2017
by
lfilippo
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIX
#3
and the fact that templates where not passed w/o -v option
parent
b1e4c38c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
latex_creator.py
latex_creator.py
+3
-2
latex_creator_main.py
latex_creator_main.py
+5
-2
run.sh
run.sh
+2
-2
No files found.
latex_creator.py
View file @
0fae3583
...
...
@@ -163,18 +163,19 @@ def tex_figure(dd, dirname):
def
modified_lines_option
(
filename
,
template_dir
):
template
=
os
.
path
.
join
(
template_dir
,
filename
)
#print(template)
cmd
=
[
'diff'
,
'--unchanged-line-format='
,
'--old-line-format='
,
"--new-line-format=
%
dn "
,
template
,
filename
]
try
:
print
(
"Running '{}'..."
.
format
(
" "
.
join
(
cmd
)))
mod_lines
=
subprocess
.
check_output
(
cmd
)
except
subprocess
.
CalledProcessError
as
ret
:
#print("Exception while running diff...")
mod_lines
=
ret
.
output
print
(
mod_lines
)
#
print(mod_lines)
mod_lines
=
mod_lines
.
split
(
" "
)
mod_lines
=
[
s
for
s
in
mod_lines
if
s
!=
""
]
#print(mod_lines)
...
...
latex_creator_main.py
View file @
0fae3583
...
...
@@ -78,6 +78,8 @@ if __name__ == '__main__':
# Untabify, TODO this should also be applied to other files
subprocess
.
call
([
"find"
,
"."
,
"-name"
,
"'*.py'"
,
"-exec"
,
"sed -i 's/
\t
/ /g'"
,
"{}"
,
";"
])
print
(
"Template dir is: "
+
args
.
template_dir
)
# Latexify, check if this is already a leaf directory
regex
=
'[0-9]{1,3}
\
.[0-9]{1,3}
\
.[0-9]{1,3}
\
.[0-9]{1,3}'
if
re
.
match
(
regex
,
os
.
path
.
split
(
args
.
results
)[
-
1
])
and
os
.
path
.
isfile
(
os
.
path
.
join
(
args
.
results
,
'.exam-setup-user'
)):
...
...
@@ -86,6 +88,7 @@ if __name__ == '__main__':
name
,
nethz
=
read_info_file
(
os
.
path
.
join
(
args
.
results
,
'.exam-setup-user'
))
student
=
"
%
s (
%
s)"
%
(
name
,
nethz
)
latex_creator
.
main
(
os
.
path
.
join
(
args
.
results
,
'results-clean'
),
ip
,
student
,
template_dir
=
args
.
template_dir
,
original_files
=
file_hashes
,
lecture_title
=
args
.
lecture
,
verbose
=
args
.
v
)
else
:
name_table
=
get_name_table
()
...
...
@@ -97,8 +100,8 @@ if __name__ == '__main__':
if
args
.
v
:
print
(
'========================================'
)
print
(
'Found student directory: '
+
si
)
local_result_dir
=
os
.
path
.
join
(
args
.
results
,
si
,
'results-clean'
)
ip
=
si
local_result_dir
=
os
.
path
.
join
(
args
.
results
,
si
,
'results-clean'
)
ip
=
si
if
si
in
name_table
:
name
,
nethz
=
name_table
[
si
]
student
=
"
%
s (
%
s)"
%
(
name
,
nethz
)
...
...
run.sh
View file @
0fae3583
...
...
@@ -127,10 +127,10 @@ if (( $+myoptions[-t] )) ; then
tmpfile
=
$(
mktemp
)
echo
$hashes
>
$tmpfile
echo
"using hashes"
echo
${
results_dir
}
| parallel
--bar
--will-cite
python2
$source_dir
/latex_creator_main.py
--hashes
$tmpfile
--results
{}
--
lecture
\'
${
lecture_title
}
\'
$verbose
>
/dev/null
echo
${
results_dir
}
| parallel
--bar
--will-cite
python2
$source_dir
/latex_creator_main.py
--hashes
$tmpfile
--results
{}
--
template-dir
${
resources
}
--lecture
\'
${
lecture_title
}
\'
>>
${
results
}
/python.log
rm
$tmpfile
else
echo
${
results_dir
}
| parallel
--bar
--will-cite
python2
$source_dir
/latex_creator_main.py
--results
{}
--lecture
\'
${
lecture_title
}
\'
$verbose
>
/dev/null
echo
${
results_dir
}
| parallel
--bar
--will-cite
python2
$source_dir
/latex_creator_main.py
--results
{}
--lecture
\'
${
lecture_title
}
\'
$verbose
>
>
${
results
}
/python.log
fi
||
exit
1
fi
fi
...
...
Ghost User
@ghost
·
Aug 28, 2017
Also added logging to "python.log". FIXES
#3 (closed)
Also added logging to "python.log". FIXES #3
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