translated

This commit is contained in:
geekpi 2022-12-27 09:43:48 +08:00
parent 27a10dfb24
commit fab40efe8c
2 changed files with 108 additions and 108 deletions

View File

@ -1,108 +0,0 @@
[#]: subject: "Try this Python-based file manager on Linux"
[#]: via: "https://opensource.com/article/22/12/linux-file-manager-dragonfly-navigator"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Try this Python-based file manager on Linux
======
Dragonfly Navigator is a general-purpose file manager written in Python and Qt. It's easy to install, easy to use, and a great example of what Python can do.
Python is a popular language for several reasons, but I think one of its primary strengths is that it's equally useful to beginner-level programmers and to experienced coders. There's something exciting about a language you can take from [drawing basic geometric shapes][1] to [scraping the web][2] to programming a zombie apocalypse [video game][3], or writing desktop applications you can use every day. And that's what Dragonfly Navigator is: a desktop utility that everyone can use.
### Installing Dragonfly Navigator
To install Dragonfly Navigator, first download the source code from its [Git repository][4]. If you're on Debian Linux or similar, download the `.deb` file. If you're using Fedora, CentOS, Mageia, OpenMandriva, or similar, then download the `.tar.gz` file.
Dragonfly Navigator has a few dependencies. Because you aren't installing it through your package manager, it's up to you to resolve those. There are just two, so use your package manager (`dnf` or `apt`) to find and install them:
- PyQt5, also called `python-qt5`
- Python PIL, also called `pillow`
### Launching Dragonfly Navigator
To launch Dragonfly Navigator, either install the `.deb` file (on Debian-based systems) or unarchive the `.tar.gz` file:
```
$ tar xvf dragonfly*gz
```
On Debian-based systems, Dragonfly Navigator appears in your application menu. ON other systems, you must launch it manually unless you [manually install it][5].
For now, I'm not installing it, so I launch it manually:
```
$ cd dragonfly
$ ./dragonfly
```
![Dragonfly Navigator is a two-panel file manager][6]
### Dual pane
Dragonfly Navigator is a two-panel file manager, meaning that it's always showing you two directories. At launch, both directories happen to be your home directory. You can browse through files and folders in either panel. They function exactly the same, and it only matters which panel you're "in" when you start copying or moving files.
### Open a directory
To open a directory, double-click it. By default, the directory opens in that same pane. If you want to utilize the two-panel layout, though, hold down the **Ctrl** key as you double-click to display its contents in the other panel.
### Open a file
To open a file, double-click or right-click on it.
Yes, you can right-click a file to open it. That takes some getting used to, if you're used to a right-click bringing up a contextual menu. There is no contextual menu in Dragonfly Navigator, though, and you might be surprised at how much time you feel like you're saving yourself when you reduce the very common action of opening a file to just one click. It may seem silly now, but trust me you'll grow to cherish it.
### Quick preview
Some files are available for a quick preview so you don't have to open them in any particular application. To preview a file, hover your mouse over it and press the **Alt** key on your keyboard. A preview appears in the opposite panel.
![The second panel of Dragonfly Navigator can be used as a preview pane.][7]
### Copying and moving files
To copy or move a file from one directory to another (or a directory to a directory), there are a few steps.
- In one panel, navigate to the destination directory. This is the location you want to copy a file _to_.
- In the other panel, select the file you want to copy.
- Click the **Copy** button in the middle strip of Dragonfly Navigator.
For moving a file, follow the same steps but click the **Move** button instead.
If you're not used to a dual-panel file manager, this feels unfamiliar at first. But if you think about it, there are several steps required to copy a file in your usual file manager (find the file, open another window, drag-and-drop, and so on.) After you do it a few times, it becomes second nature.
### Selecting files
Normally, you click a file or folder to make it your active selection. That's probably no different than your current file manager, or at least to some file manager you've used in the past.
To select multiple items in a range, click one file, and then hold the **Shift** key and click another file. All items between the two files you clicked are also selected.
To select multiple arbitrary files, hold the **Ctrl** key and click on the files you want selected.
### The power of Qt and Python
The Qt toolkit is a powerful programming utility, and Python is capable of creating great applications with it. I've only covered the basics of Dragonfly Navigator in this article, so download it, read the docs, click around, explore it, and maybe you'll have found a fun new file manager.
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/12/linux-file-manager-dragonfly-navigator
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/17/10/python-101#turtle
[2]: https://opensource.com/article/20/5/web-scraping-python
[3]: https://opensource.com/downloads/python-gaming-ebook
[4]: https://github.com/suncore/dflynav/releases
[5]: https://opensource.com/article/18/1/how-install-apps-linux
[6]: https://opensource.com/sites/default/files/2022-10/dragonfly-navigator.webp
[7]: https://opensource.com/sites/default/files/2022-10/dragonfly-navigator-preview.webp

View File

@ -0,0 +1,108 @@
[#]: subject: "Try this Python-based file manager on Linux"
[#]: via: "https://opensource.com/article/22/12/linux-file-manager-dragonfly-navigator"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lkxed"
[#]: translator: "geekpi"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在 Linux 上试试这个基于 Python 的文件管理器
======
Dragonfly Navigator 是用 Python 和 Qt 编写的通用文件管理器。它易于安装和使用,并且是 Python 可以做什么的一个很好的例子。
Python 是一种流行的语言有几个原因,但我认为它的主要优势之一是它对初级程序员和有经验的编码人员同样有用。你可以从一门语言中获得一些令人兴奋的东西,从[绘制基本几何形状][1]到[抓取网页][2]再到编写僵尸启示录[游戏][3],或者编写你每天都可以使用的桌面应用。这就是 Dragonfly Navigator一个人人都可以使用的桌面程序。
### 安装 Dragonfly Navigator
要安装 Dragonfly Navigator首先从 [Git 仓库][4]下载源代码。如果你使用的是 Debian Linux 或类似软件,请下载 `.deb` 文件。如果你使用的是 Fedora、CentOS、Mageia、OpenMandriva 或类似软件,请下载 `.tar.gz` 文件。
Dragonfly Navigator 只有很少的依赖。因为你不是通过包管理器安装它,所以由你来解决这些问题。它只有两个依赖,所以使用你的包管理器(`dnf` 或 `apt`)找到并安装它们:
- PyQt5也称为 `python-qt5`
- Python PIL也称为 `pillow`
### 启动 Dragonfly Navigator
要启动 Dragonfly Navigator请安装 `.deb` 文件(在基于 Debian 的系统上)或解压缩 `.tar.gz` 文件:
```
$ tar xvf dragonfly*gz
```
在基于 Debian 的系统上Dragonfly Navigator 出现在你的应用菜单中。在其他系统上,你必须手动启动它,除非你[手动安装][5]。
现在,我没有安装它,所以我手动启动它:
```
$ cd dragonfly
$ ./dragonfly
```
![Dragonfly Navigator is a two-panel file manager][6]
### 双面板
Dragonfly Navigator 是一个双面板文件管理器,这意味着它总是向你显示两个目录。在启动时,这两个目录恰好是你的主目录。你可以在任一面板中浏览文件和文件夹。它们的功能完全相同,只有当你开始复制或移动文件时你“位于”哪个面板中才重要。
### 打开目录
要打开目录,请双击它。默认情况下,该目录在同一面板中打开。但是,如果你想使用双面板布局,请在双击时按住 **Ctrl** 键以在另一个面板中显示其内容。
### 打开文件
要打开文件,请双击或右键单击它。
是的你可以右键单击文件将其打开。如果你习惯于右键单击调出上下文菜单那么这需要一些时间来适应。不过Dragonfly Navigator 中没有上下文菜单,你可能会惊讶地发现,当你将打开文件这一非常常见的操作减少到只需单击一次时,你会觉得自己节省了多少时间。现在可能看起来很傻,但相信我,你会逐渐珍惜它的。
### 快速预览
某些文件可用于快速预览,因此你不必在任何特定应用中打开它们。要预览文件,请将鼠标悬停在文件上,然后按键盘上的 **Alt** 键。预览出现在对面的面板中。
![The second panel of Dragonfly Navigator can be used as a preview pane.][7]
### 复制和移动文件
要将文件从一个目录复制或移动到另一个目录(或从一个目录到另一个目录),有几个步骤。
- 在一个面板中,进入目标目录。这是你要将文件复制到的位置。
- 在另一个面板中,选择要复制的文件。
- 单击 Dragonfly Navigator 中间条中的**复制**按钮。
要移动文件,请按照相同的步骤操作,但要单击**移动**按钮。
如果你不习惯双面板文件管理器,一开始会觉得很陌生。但是你仔细想想,在你常用的文件管理器中复制一个文件需要几个步骤(找到文件,打开另一个窗口,拖放等等)。做几次之后,它 成为第二天性。
### 选择文件
通常,你单击一个文件或文件夹以使其成为你的活动选择。这可能与你当前的文件管理器没有什么不同,或者至少与你过去使用过的某些文件管理器没有什么不同。
要选择一个范围内的多个项目,请单击一个文件,然后按住 **Shift** 键并单击另一个文件。你单击的两个文件之间的所有项目也被选中。
要选择多个任意文件,请按住 **Ctrl** 键并单击要选择的文件。
### Qt 和 Python 的力量
Qt 工具包是一个强大的编程程序Python 能够用它创建出色的应用。我在本文中只介绍了 Dragonfly Navigator 的基础知识,所以请下载它,阅读文档,点击并探索它,也许你会发现一个有趣的新文件管理器。
--------------------------------------------------------------------------------
via: https://opensource.com/article/22/12/linux-file-manager-dragonfly-navigator
作者:[Seth Kenlon][a]
选题:[lkxed][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lkxed
[1]: https://opensource.com/article/17/10/python-101#turtle
[2]: https://opensource.com/article/20/5/web-scraping-python
[3]: https://opensource.com/downloads/python-gaming-ebook
[4]: https://github.com/suncore/dflynav/releases
[5]: https://opensource.com/article/18/1/how-install-apps-linux
[6]: https://opensource.com/sites/default/files/2022-10/dragonfly-navigator.webp
[7]: https://opensource.com/sites/default/files/2022-10/dragonfly-navigator-preview.webp