Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Tobias Langer
/
experiment
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ad3f235b
authored
Nov 14, 2016
by
Tobias Langer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ignore unimportant errors and move remove errornous files.
parent
45b8c468
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
runner.py
+11
-5
No files found.
runner.py
View file @
ad3f235b
...
...
@@ -36,10 +36,7 @@ def create_dir(filename):
try
:
os
.
makedirs
(
filename
)
except
FileExistsError
:
if
not
query_yes_no
(
'Folder exists, remove?'
,
default
=
'yes'
):
return
False
shutil
.
rmtree
(
filename
)
os
.
makedirs
(
filename
)
pass
return
True
class
cd
:
...
...
@@ -73,8 +70,13 @@ def main():
for
experiment
in
os
.
listdir
():
if
experiment
==
'results'
or
not
os
.
path
.
isdir
(
experiment
):
continue
if
experiment
.
isdigit
():
continue
experiment_file
=
os
.
path
.
join
(
'results'
,
experiment
+
'.out'
)
if
os
.
path
.
exists
(
experiment_file
):
continue
with
open
(
os
.
path
.
join
(
'results'
,
experiment
+
'.out'
)
,
'w'
)
as
of
:
with
open
(
experiment_file
,
'w'
)
as
of
:
with
cd
(
experiment
):
try
:
p
=
Popen
([
'./'
+
experiment
],
stdout
=
of
)
...
...
@@ -84,6 +86,10 @@ def main():
print
(
'Failed running experiment: {}'
.
format
(
experiment
),
file
=
sys
.
stderr
)
sys
.
exit
(
1
)
if
os
.
stat
(
experiment_file
)
.
st_size
==
0
:
print
(
'Removing file after failed experiment.'
,
file
=
sys
.
stderr
)
os
.
remove
(
experiment_file
)
shutil
.
rmtree
(
experiment
)
# with cd(experiment):
...
...
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