简单的python桌面集成。
desktop3的Python项目详细描述
这是desktop包的python 3端口。
The desktop package provides desktop environment detection and resource opening support for a selection of common and standardised desktop environments.
安装
pip install desktop3
用法
启动文件夹、文件等:
importdesktopdesktop.open("what/you/want/to/open")
简介
桌面包提供桌面环境检测和资源 开放式支持选择通用和标准化桌面 环境。
目前,在python的标准库中,显然没有一致性, 使用户环境“打开”文件或 当 由python程序请求的。有一个os.startfile函数可以工作 对于Windows,但对于其他桌面环境没有等效的功能- WebBrowser模块似乎在选择和 运行外部程序,可能不寻求提供 仍然支持非url资源。
因为像kde和gnome这样的桌面环境提供了运行的机制 根据文件或资源的标识类型的浏览器和编辑器, 正如windows“运行”文件或资源一样,有一个模块是合适的 访问这些机制。正是这种功能 桌面包旨在支持。注意,这种方法可以说是更好的 比webbrowser模块使用的多,因为大多数桌面环境 已经提供了配置和选择用户首选项的机制 用于各种活动的程序,而webbrowser模块 相对不知情的猜测(例如,在kde桌面上打开firefox 配置为使用konqueror作为默认浏览器)。
桌面检测(xfce)和url打开(xfce,x11)的一些想法是 从xdg utils项目获得,该项目旨在实现程序 执行与桌面模块中的类似功能。这个 xdg utils项目可以在这里找到:
http://portland.freedesktop.org/
有关桌面图标和菜单、屏幕保护程序和mime的其他信息 配置也可以在xdg实用程序中找到。
联系人、版权和许可信息
尚未提供此工作的网页,但作者可以 通过以下电子邮件地址联系:
版权和许可信息可在文档目录中找到-请参阅 docs/copying.txt、docs/lgpl-3.0.txt和docs/gpl-3.0.txt了解更多信息。
注释
桌面应用程序/环境支持说明:
KDE | Supports file and URL opening using kfmclient, where the openURL command opens the resource and the exec command runs the resource. |
KDE 4 | Similar to KDE but uses kioclient instead of kfmclient. |
GNOME | Supports file and URL opening using gnome-open. |
XFCE | Supports file and URL opening using exo-open. |
ROX-Filer | Supports file opening using “rox <filename>” but not URL opening. |
更改日志
- 0.5.3(2019年8月19日)
- 修复:无法检测xfce。
- 0.5.2(2016年10月26日)
- 将docs文件夹添加到dist文件中。
- 0.5.1(2016年10月25日)
- 修复setup.py中的字母大小写问题。
- 0.5.0(2016年7月2日)
- 第一次释放。
旧更改日志
桌面0.4.3中的新功能(自桌面0.4.2以来的更改)
- Added missing KDE 4 support to the desktop.dialog module.
桌面0.4.2中的新功能(自桌面0.4.1以来的更改)
- Added XFCE 4.10 “mailto:” fix contributed by Jérôme Laheurte.
桌面0.4.1中的新功能(自桌面0.4以来的更改)
- Added KDE 4 and Lubuntu support contributed by Jérôme Laheurte.
桌面0.4中的新功能(自桌面0.3以来的更改)
- Improved docstrings.
- Fixed support for examining the root window.
- Changed the licence to the LGPL version 3 (or later).
桌面0.3中的新功能(自桌面0.2.4以来的更改)
- Made desktop a package.
- Added support for graphical dialogue boxes through programs such as kdialog, zenity and Xdialog.
- Added support for inspecting desktop windows (currently only for X11).
桌面0.2.4中的新功能(自桌面0.2.3以来的更改)
- Added XFCE support (with advice from Miki Tebeka).
- Added Ubuntu Feisty (7.04) package support.
桌面0.2.3中的新功能(自桌面0.2.2以来的更改)
- Added Python 2.3 support (using popen2 instead of subprocess).
桌面0.2.2中的新功能(自桌面0.2.1以来的更改)
- Changed the licence to LGPL.
桌面0.2.1中的新功能(自桌面0.2以来的更改)
- Added Debian/Ubuntu package support.
桌面0.2中的新功能(自桌面0.1以来的更改)
- Added support for waiting for launcher processes.
- Added a tests directory.