Skip to content

Commit 0baa833

Browse files
authored
Merge pull request #10 from sonibla/master
Porting to Python 3
2 parents a5d363d + d7ff5bf commit 0baa833

2 files changed

Lines changed: 44 additions & 30 deletions

File tree

README.md

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@
88

99
## Table of contents
1010

11-
<!-- MarkdownTOC -->
12-
1311
- [Components](#components)
14-
- [PDFMtEd Editor](#pdfmted-editor)
15-
- [PDFMtEd Inspector](#pdfmted-inspector)
16-
- [PDFMtEd Thumbnailer](#pdfmted-thumbnailer)
12+
* [PDFMtEd Editor](#pdfmted-editor)
13+
* [PDFMtEd Inspector](#pdfmted-inspector)
14+
* [PDFMtEd Thumbnailer](#pdfmted-thumbnailer)
1715
- [Installation and dependencies](#installation-and-dependencies)
18-
- [Dependencies](#dependencies)
19-
- [Overview of all dependencies](#overview-of-all-dependencies)
20-
- [Dependency breakdown](#dependency-breakdown)
21-
- [Installation](#installation)
22-
- [Uninstall PDFMtEd](#uninstall-pdfmted)
16+
* [Dependencies](#dependencies)
17+
+ [Ubuntu 16.04 or lower](#ubuntu-1604-or-lower)
18+
+ [Most other Linux distribution based on Debian or Ubuntu](#most-other-linux-distribution-based-on-debian-or-ubuntu)
19+
+ [Fedora and most other Linux distribution based on Fedora](#fedora-and-most-other-linux-distribution-based-on-fedora)
20+
+ [Arch Linux or Manjaro](#arch-linux-or-manjaro)
21+
+ [Dependency breakdown](#dependency-breakdown)
22+
* [Installation](#installation)
23+
* [Uninstall PDFMtEd](#uninstall-pdfmted)
2324
- [Usage](#usage)
24-
- [General usage](#general-usage)
25-
- [PDFMtEd Editor](#pdfmted-editor-1)
26-
- [User interface](#user-interface)
27-
- [Command-line options](#command-line-options)
28-
- [PDFMtEd Inspector](#pdfmted-inspector-1)
29-
- [PDFMtEd Thumbnailer](#pdfmted-thumbnailer-1)
25+
* [General usage](#general-usage)
26+
* [PDFMtEd Editor](#pdfmted-editor-1)
27+
+ [User interface](#user-interface)
28+
+ [Command-line options](#command-line-options)
29+
* [PDFMtEd Inspector](#pdfmted-inspector-1)
30+
* [PDFMtEd Thumbnailer](#pdfmted-thumbnailer-1)
3031
- [Additional information](#additional-information)
31-
- [Modified metadata tags](#modified-metadata-tags)
32-
- [Purging metadata](#purging-metadata)
32+
* [Modified metadata tags](#modified-metadata-tags)
33+
* [Purging metadata](#purging-metadata)
3334
- [Known issues](#known-issues)
3435
- [License](#license)
3536

36-
<!-- /MarkdownTOC -->
37-
3837
## Components
3938

4039
### PDFMtEd Editor
@@ -82,19 +81,33 @@ PDFMtEd Thumbnailer should be able to generate thumbnails for all file types sup
8281

8382
## Installation and dependencies
8483

85-
The following instructions are provided for Ubuntu. Package names and repositories might differ on other distributions.
84+
The following instructions are provided for most Linux distributions.
8685

8786
### Dependencies
8887

89-
#### Overview of all dependencies
88+
89+
*Optional but recommended*: [sejda-console](https://github.com/torakiki/sejda/releases)
90+
91+
#### Ubuntu 16.04 or lower
9092

9193
Install all dependencies on Ubuntu with the following commands:
9294

9395
sudo add-apt-repository ppa:webupd8team/y-ppa-manager
9496
sudo apt-get update
9597
sudo apt-get install yad libimage-exiftool-perl qpdf
9698

97-
*Optional but recommended*: [sejda-console](https://github.com/torakiki/sejda/releases)
99+
100+
#### Most other Linux distribution based on Debian or Ubuntu
101+
102+
sudo apt install libimage-exiftool-perl yad qpdf
103+
104+
#### Fedora and most other Linux distribution based on Fedora
105+
106+
sudo dnf install perl-Image-ExifTool yad qpdf
107+
108+
#### Arch Linux or Manjaro
109+
110+
sudo pacman -S perl-image-exiftool yad qpdf
98111

99112
#### Dependency breakdown
100113

@@ -103,7 +116,7 @@ Install all dependencies on Ubuntu with the following commands:
103116
- [YAD](http://sourceforge.net/projects/yad-dialog/): graphical front-end for bash scripts, a Zenity fork; provided by Webupd8 PPA
104117
- [ExifTool](http://www.sno.phy.queensu.ca/~phil/exiftool/): general purpose metadata editing application and library
105118
- [qpdf](http://qpdf.sourceforge.net/): command-line program that does structural, content-preserving transformations on PDF files; used in this project to restore broken PDF files and purge documents of residual metadata
106-
- Python 2.7 is required for the thumbnailer and thumbnail preview to work. This should be installed on your system by default.
119+
- Python 3 is required for the thumbnailer and thumbnail preview to work. This should be installed on your system by default.
107120

108121
**Recommended:**
109122

@@ -129,7 +142,7 @@ After the installation PDFMtEd Editor and Inspector should be available as entri
129142

130143
![file manager context menu with PDFMtEd entries](https://github.com/Glutanimate/PDFMtEd/blob/master/screenshots/pdfmted_usage.png)
131144

132-
If you can't find the entries click on *Other application* (arrow) and navigate to *Show other applications*. You should be able to find the PDFMtEd launchers in the list. Double-click on *PDFMtEd Inspector* to open the application. This will automatically add a context menu entry. Repeat the procedure for *PDFMtEd Editor* and you are set.
145+
If you can't find the entries click on *Other application* (arrow) and navigate to *Show other applications*. You should be able to find the PDFMtEd launchers in the list. Double-click on *PDFMtEd Inspector* to open the application. This will automatically add a context menu entry. Repeat the procedure for *PDFMtEd Editor* and you are set.
133146

134147
### Uninstall PDFMtEd
135148

@@ -143,6 +156,7 @@ Follow these steps to uninstall the PDFMted utilities:
143156

144157
sudo ./uninstall.sh
145158

159+
146160
## Usage
147161

148162
### General usage

pdfmted-thumbnailer

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python2.7
1+
#!/usr/bin/python3
22

33
# General purpose GNOME thumbnailer script
44
# Written by James Henstridge (http://askubuntu.com/a/201997)
@@ -18,19 +18,19 @@ def make_thumbnail(factory, filename):
1818
mime_type = info.get_content_type()
1919

2020
if factory.lookup(uri, mtime) is not None:
21-
print "FRESH %s" % uri
21+
print("FRESH %s" % uri)
2222
return False
2323

2424
if not factory.can_thumbnail(uri, mime_type, mtime):
25-
print "UNSUPPORTED %s" % uri
25+
print("UNSUPPORTED %s" % uri)
2626
return False
2727

2828
thumbnail = factory.generate_thumbnail(uri, mime_type)
2929
if thumbnail is None:
30-
print "ERROR %s" % uri
30+
print("ERROR %s" % uri)
3131
return False
3232

33-
print "OK %s" % uri
33+
print("OK %s" % uri)
3434
factory.save_thumbnail(thumbnail, uri, mtime)
3535
return True
3636

0 commit comments

Comments
 (0)