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
bwinf
medal
Commits
bee213c2
Commit
bee213c2
authored
Aug 17, 2018
by
Robert Czechowski
Browse files
cleanup config
parent
d4d11615
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main.rs
View file @
bee213c2
//#![feature(extern_prelude)]
#[macro_use]
extern
crate
iron
;
#[macro_use]
...
...
@@ -113,22 +111,7 @@ fn read_contest(p: &path::PathBuf) -> Option<Contest> {
let
mut
contents
=
String
::
new
();
file
.read_to_string
(
&
mut
contents
)
.unwrap
();
configreader_yaml
::
parse_yaml
(
&
contents
,
p
.file_name
()
.to_owned
()
?
.to_str
()
?
,
&
format!
(
"{}/"
,
p
.parent
()
.unwrap
()
.to_str
()
?
))
// unwrap_or("./")?
/*let mut contest = Contest::new("./".to_string(), "blub.json".to_string(), "Wettbewerb IX".to_string(), 45, true, None, None);
let mut taskgroup = Taskgroup::new("Lustige Aufgabe".to_string());
let mut task = Task::new("blub".to_string(), 1);
taskgroup.tasks.push(task);
let mut task = Task::new("blub2".to_string(), 4);
taskgroup.tasks.push(task);
contest.taskgroups.push(taskgroup);
let mut taskgroup = Taskgroup::new("Lustige Aufgabe3".to_string());
let mut task = Task::new("blub3".to_string(), 2);
taskgroup.tasks.push(task);
let mut task = Task::new("blub4".to_string(), 3);
taskgroup.tasks.push(task);
contest.taskgroups.push(taskgroup);
Some(contest)*/
configreader_yaml
::
parse_yaml
(
&
contents
,
p
.file_name
()
.to_owned
()
?
.to_str
()
?
,
&
format!
(
"{}/"
,
p
.parent
()
.unwrap
()
.to_str
()
?
))
}
fn
get_all_contest_info
(
task_dir
:
&
str
)
->
Vec
<
Contest
>
{
...
...
tasks/contest1.yaml
View file @
bee213c2
...
...
@@ -6,10 +6,10 @@ public_listing: true
tasks
:
"
Aufgabe
1"
:
"
blub"
"
Aufgabe
2"
:
[
"
tasks/
task2a"
,
"
task
s/task2b"
,
"
tasks/
task3"
]
"
Aufgabe
2"
:
[
"
task2a"
,
"
task
2b"
,
"
task3"
]
"
Aufgabe
3"
:
"
blub/"
:
{
stars
:
1
}
"
blub/index.html"
:
{
stars
:
3
}
"
tasks/
task3"
:
{
stars
:
5
}
"
task3"
:
{
stars
:
5
}
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