BLKSerene / Wordless

An Integrated Corpus Tool With Multilingual Support for the Study of Language, Literature, and Translation
GNU General Public License v3.0
686 stars 90 forks source link

Misc: Dedent shortcut file #27

Closed tanloong closed 1 year ago

tanloong commented 1 year ago

Wordless.desktop now looks a little bit better.

https://docs.python.org/3/library/textwrap.html?highlight=textwrap#textwrap.dedent

cat ~/.local/share/applications/Wordless.desktop
...

        [Desktop Entry]
        Type=Application
        Name=Wordless
        Version=1.0.0
        Encoding=UTF-8
        Path=/home/tan/projects/wordless/./utils
        Exec=bash -c "./Wordless.sh; $SHELL"
        Icon=/home/tan/projects/wordless/./utils/imgs/wl_icon.ico
        Terminal=true
cat ~/.local/share/applications/Wordless.desktop
...
[Desktop Entry]
Type=Application
Name=Wordless
Version=1.0.0
Encoding=UTF-8
Path=/home/tan/projects/wordless/utils
Exec=bash -c "./Wordless.sh; $SHELL"
Icon=/home/tan/projects/wordless/utils/imgs/wl_icon.ico
Terminal=true
BLKSerene commented 1 year ago

Hi, IMHO textwrap.dedent is used where the string or text is to be printed out and checked further by human.

The .desktop file for Linux would work regardless of any extra whitespace, and this file is intended to be read by machine, not human, so there are no reason to complicate the code using textwrap (I indent the contents of the .desktop file within the triple-quoted strings just to comply to my coding conventions).

tanloong commented 1 year ago

I'm completely OK with your decision. Thanks for the explanation.

Closing the PR.