This commit is contained in:
Václav Španinger 2024-09-11 07:59:00 -07:00
parent 51d9389f6d
commit 41aa2b7c7b
3 changed files with 41 additions and 35 deletions

View File

@ -38,30 +38,34 @@ namespace FakeeDeck.Class
continue;
}
Console.WriteLine(level + "> level " + linesParsedPreviuse + " Lines handeled previouselly '" + line + "'");
if ((level > levelStart || level == 0))
Console.WriteLine(level + ">"+ levelStart + " level " + linesParsedPreviuse + " Lines handeled previouselly '" + line + "'");
if ((level > levelStart || levelStart == 0))
{
if (line.Contains(":"))
{
Console.WriteLine("Key:Value Pair");
iterator = 0;
string[] array = line.Split(":");
string key = array[0];
string key = array[0].Trim('\t');
dynamic value = "";
if (array.Length > 0)
if (array.Length > 1 && !string.IsNullOrEmpty(array[1]))
{
tempObject[key] = array[1];
Console.WriteLine("Strict Value Found: " + array[1]);
tempObject.Add(key,array[1]);
}
else if (array.Length == 1 && lines[linesParsed..lines.Length].Length > 0)
else if (array.Length == 2 && string.IsNullOrEmpty(array[1]) && lines[linesParsed..lines.Length].Length > 0)
{
tempObject[key] = ParseYamlFile(lines[linesParsed..lines.Length], level, linesParsed);
tempObject.Add(key, ParseYamlFile(lines[linesParsed..lines.Length], level, linesParsed));
}
} else
{
iterator++;
tempObject[iterator] = line;
tempObject.Add(iterator,line);
}
} else if (level < levelStart)
{
Console.WriteLine("Level DOwns");
}
}
}

View File

@ -6,8 +6,6 @@ using System.Text.Json;
YamlConfig parser = new YamlConfig("configuration.yaml");
var result = parser.Data;
Console.WriteLine(JsonSerializer.Serialize(result));
#HttpServer.serv();
//HttpServer.serv();

View File

@ -1,26 +1,30 @@
server:
port: 8000
pages:
- helldivers:
- test1:
name: test
type: keyboard
url: https://www.reddit.com/r/kde/comments/fen7lj/plasmoid_for_managing_docker_containers/
- page: helldivers,
buttons:
- button: b_1,
name: test,
type: keyboard,
url: https://www.reddit.com/r/kde/comments/fen7lj/plasmoid_for_managing_docker_containers/,
action:
- 0x31
- 0x31
- test2:
name: test2
type: keyboard
url: https://www.reddit.com/
- button: b_2,
name: test,
type: keyboard,
url: https://www.reddit.com/r/kde/comments/fen7lj/plasmoid_for_managing_docker_containers/,
action:
- 0x31
- 0x31
- media:
- mute:
name: mute
type: keyboard
url: https://www.reddit.com/r/kde/comments/fen7lj/plasmoid_for_managing_docker_containers/
- page: media,
buttons:
- button: b_1,
name: test,
type: keyboard,
url: https://www.reddit.com/,
action:
- 0x33
- 0x31
- 0x31