desktop-entry-lib-3.0
توضیحات
A library for working with .desktop files
| ویژگی | مقدار |
|---|---|
| سیستم عامل | POSIX :: Linux |
| نام فایل | desktop-entry-lib-3.0 |
| نام | desktop-entry-lib |
| نسخه کتابخانه | 3.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | JakobDev <jakobdev@gmx.de> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/desktop-entry-lib/ |
| مجوز | BSD-2-Clause |
# desktop-entry-lib






desktop-entry-lib allows reading and writing .desktop files according to the [Desktop Entry Specification](https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html)
```python
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:
- Fully static typed
- No external dependencies
- Full Documentation and Examples available
- Support running inside a [Flatpak](https://flatpak.org)
- The whole lib is a single file
- Supports [PyPy](https://www.pypy.org)
[Read the documentation](https://desktop-entry-lib.readthedocs.io)
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.9 | Python |
نحوه نصب
نصب پکیج whl desktop-entry-lib-3.0:
pip install desktop-entry-lib-3.0.whl
نصب پکیج tar.gz desktop-entry-lib-3.0:
pip install desktop-entry-lib-3.0.tar.gz