JuneStepp / OneLauncher

Launcher and Addons Manager for LOTRO and DDO
Other
45 stars 11 forks source link

Prettyfy XML *.config files #7

Closed Technical-13 closed 4 years ago

Technical-13 commented 4 years ago
<?xml version="1.0" ?>
<Settings>
    <Default.Game>LOTRO</Default.Game>
    <DDO.Test>
        <HiRes>False</HiRes>
        <x64Client>False</x64Client>
        <Game.Directory>C:\Program Files (x86)\StandingStoneGames\Dungeons &amp; Dragons Online (Preview)</Game.Directory>
        <PatchClient>patchclient.dll</PatchClient>
        <Language>EN</Language>
        <Accounts>
            <DDOplayer>
                <World>Lamannia</World>
            </DDOplayer>
        </Accounts>
    </DDO.Test>
    <DDO>
        <HiRes>False</HiRes>
        <x64Client>False</x64Client>
        <Game.Directory>C:\Program Files (x86)\Steam\steamapps\common\Dungeons and Dragons Online</Game.Directory>
        <PatchClient>patchclient.dll</PatchClient>
        <Language>EN</Language>
        <Accounts>
            <DDOplayer>
                <World>Cannith</World>
            </DDOplayer>
        </Accounts>
    </DDO>
    <LOTRO>
        <HiRes>False</HiRes>
        <x64Client>False</x64Client>
        <Game.Directory>C:\Program Files (x86)\Steam\steamapps\common\Lord of the Rings Online</Game.Directory>
        <PatchClient>patchclient.dll</PatchClient>
        <Language>EN</Language>
        <Accounts>
            <LOTROplayer>
                <World>Landroval [US-RE]</World>
            </LOTROplayer>
        </Accounts>
    </LOTRO>
</Settings>

...is so much easier to read and troubleshoot than...

<?xml version="1.0" ?><Settings><Default.Game>LOTRO</Default.Game><DDO.Test><HiRes>False</HiRes><x64Client>False</x64Client><Game.Directory>C:\Program Files (x86)\StandingStoneGames\Dungeons &amp; Dragons Online (Preview)</Game.Directory><PatchClient>patchclient.dll</PatchClient><Language>EN</Language><Accounts><DDOplayer><World>Lamannia</World></DDOplayer></Accounts></DDO.Test><DDO><HiRes>False</HiRes><x64Client>False</x64Client><Game.Directory>C:\Program Files (x86)\Steam\steamapps\common\Dungeons and Dragons Online</Game.Directory><PatchClient>patchclient.dll</PatchClient><Language>EN</Language><Accounts><DDOplayer><World>Cannith</World></DDOplayer></Accounts></DDO><LOTRO><HiRes>False</HiRes><x64Client>False</x64Client><Game.Directory>C:\Program Files (x86)\Steam\steamapps\common\Lord of the Rings Online</Game.Directory><PatchClient>patchclient.dll</PatchClient><Language>EN</Language><Accounts><LOTROplayer><World>Landroval [US-RE]</World></LOTROplayer></Accounts></LOTRO></Settings>

...perhaps using a library like https://pypi.org/project/xmlformatter/

JuneStepp commented 4 years ago

After a fair bit of searching I found a good library called vkbeautify, so it's done now.