A library for working with .desktop files
Project description
desktop-entry-lib
desktop-entry-lib allows reading and writing .desktop files according to the Desktop Entry Specification
import desktop_entry_lib
def write() -> None:
entry = desktop_entry_lib.DesktopEntry()
entry.Name.default_text = "My App"
entry.Comment.default_text = "A short description"
entry.Comment.translations["de"] = "A short german description"
entry.Type = "Application"
entry.Exec = "my-app"
entry.write_file("my_app.desktop")
def read() -> None:
entry = desktop_entry_lib.DesktopEntry.from_file("my_app.desktop")
print("Name: " + entry.Name.default_text)
print("Comment: " + entry.Comment.default_text)
print("German translation for Comment: " + entry.Comment.translations.get("de", "None"))
print("Type: " + entry.Type)
print("Exec: " + entry.Exec)
if __name__ == "__main__":
write()
read()
Features:
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
desktop-entry-lib-2.3.tar.gz
(9.1 kB
view hashes)
Built Distribution
Close
Hashes for desktop_entry_lib-2.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2d4f8dfbf2e5a168722b14ae98c3f7e4af7f49e895c909dcbc31541c079b72f |
|
MD5 | 30f41b99411d767f65197b6081eda8eb |
|
BLAKE2b-256 | 224b3e519a1e062d39ff0affb969e2e32f14c8765b84f2d5223ba9488f3c04aa |