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; continue;
} }
Console.WriteLine(level + "> level " + linesParsedPreviuse + " Lines handeled previouselly '" + line + "'"); Console.WriteLine(level + ">"+ levelStart + " level " + linesParsedPreviuse + " Lines handeled previouselly '" + line + "'");
if ((level > levelStart || levelStart == 0))
if ((level > levelStart || level == 0))
{ {
if (line.Contains(":")) if (line.Contains(":"))
{ {
Console.WriteLine("Key:Value Pair");
iterator = 0; iterator = 0;
string[] array = line.Split(":"); string[] array = line.Split(":");
string key = array[0]; string key = array[0].Trim('\t');
dynamic value = ""; 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 } else
{ {
iterator++; 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"); YamlConfig parser = new YamlConfig("configuration.yaml");
var result = parser.Data; var result = parser.Data;
Console.WriteLine(JsonSerializer.Serialize(result)); Console.WriteLine(JsonSerializer.Serialize(result));
//HttpServer.serv();
#HttpServer.serv();

View File

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