[Xfce4-commits] [bindings/thunarx-python] 02/03: Update docs with new 0.5.0 updates
noreply at xfce.org
noreply at xfce.org
Sat Dec 23 03:34:15 CET 2017
This is an automated email from the git hooks/post-receive script.
a d a m p l u m b p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository bindings/thunarx-python.
commit 756387982844784e6005b7a9eeabe156f59dbc05
Author: Adam Plumb <adamplumb at gmail.com>
Date: Fri Dec 22 21:33:55 2017 -0500
Update docs with new 0.5.0 updates
---
.gitignore | 7 ++++++-
docs/reference/thunarx-python-menu-provider.xml | 6 +++---
docs/reference/thunarx-python-overview-example.xml | 2 +-
docs/reference/thunarx-python-overview.xml | 14 ++++++++++++++
docs/reference/thunarx-python-preferences-provider.xml | 1 +
docs/reference/thunarx-python-property-page-provider.xml | 13 +++++++++----
6 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/.gitignore b/.gitignore
index 3da3252..d7070f3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ Makefile
Makefile.in
depcomp
stamp-h1
+*.stamp
missing
*.tar.gz
*.tar.bz2
@@ -21,4 +22,8 @@ configure
configure.ac
*.m4
*.make
-
+docs/*.html
+docs/*.png
+docs/*.css
+builddate.xml
+*.devhelp2
diff --git a/docs/reference/thunarx-python-menu-provider.xml b/docs/reference/thunarx-python-menu-provider.xml
index b4bada6..2bb53f5 100644
--- a/docs/reference/thunarx-python-menu-provider.xml
+++ b/docs/reference/thunarx-python-menu-provider.xml
@@ -71,7 +71,7 @@ class ThunarxMenuProviderPlugin(GObject.GObject, Thunarx.MenuProvider):
return [Thunarx.MenuItem(name="TMP:TestFolderAction", label="Python Folder Action", tooltip='', icon=Gtk.STOCK_OPEN)]
def __do_something(self, item, window):
- print "Doing something"
+ print("Doing something")
</programlisting>
</example>
@@ -112,10 +112,10 @@ class ThunarxSubMenuProviderPlugin(GObject.GObject, Thunarx.MenuProvider):
return item,item2
def __subitem1_callback(self, item, window):
- print "Subitem1 call"
+ print("Subitem1 call")
def __subitem2_callback(self, item, window):
- print "Subitem2 call"
+ print("Subitem2 call")
</programlisting>
</example>
diff --git a/docs/reference/thunarx-python-overview-example.xml b/docs/reference/thunarx-python-overview-example.xml
index 0c00821..88690ab 100644
--- a/docs/reference/thunarx-python-overview-example.xml
+++ b/docs/reference/thunarx-python-overview-example.xml
@@ -27,7 +27,7 @@ class ThunarxMenuProviderPlugin(GObject.GObject, Thunarx.MenuProvider):
return [Thunarx.MenuItem(name="TMP:TestFolderAction", label="Python Folder Action", tooltip='', icon=Gtk.STOCK_OPEN)]
def __do_something(self, item, window):
- print "Doing something"
+ print("Doing something")
</programlisting>
</example>
diff --git a/docs/reference/thunarx-python-overview.xml b/docs/reference/thunarx-python-overview.xml
index 11cd40a..3d2870d 100644
--- a/docs/reference/thunarx-python-overview.xml
+++ b/docs/reference/thunarx-python-overview.xml
@@ -27,12 +27,26 @@
<para>As of thunarx-python 0.3.0, python extensions are installed in $XDG_DATA_DIR/thunarx-python/extensions where $XDG_DATA_DIR
could be /usr/share for a global install or ~/.local/share for a local install.</para>
</note>
+
+ <note>
+<para>As of thunarx-python 0.5.0, python extensions are loaded in the following order:
+
+ 1. $XDG_DATA_HOME/thunarx-python/extensions
+ 2. thunar_prefix/share/thunarx-python/extensions
+ 3. $XDG_DATA_DIRS/thunarx-python/extensions
+ 4. THUNARX_EXTENSION_DIR/python (i.e. /usr/lib64/thunarx-3/python)</para>
+ </note>
<note>
<title>thunarx-3</title>
<para>As of thunar v1.7.0, thunarx requires Gtk+3 and no longer accepts gtk.Actions. Instead, it expects Thunarx.MenuItems.</para>
</note>
+ <note>
+ <title>python3</title>
+ <para>As of thunarx-python v0.5.0, thunarx-python can be built to embed python3 instead of python2. It uses the $PYTHON environment variable to determine which library to use.</para>
+ </note>
+
<xi:include href="thunarx-python-overview-example.xml"/>
</chapter>
diff --git a/docs/reference/thunarx-python-preferences-provider.xml b/docs/reference/thunarx-python-preferences-provider.xml
index 366235a..d039962 100644
--- a/docs/reference/thunarx-python-preferences-provider.xml
+++ b/docs/reference/thunarx-python-preferences-provider.xml
@@ -51,6 +51,7 @@ class DialogExample(Gtk.Dialog):
Gtk.STOCK_OK, Gtk.ResponseType.OK))
self.set_default_size(150, 100)
+ self.set_transient_for(parent)
label = Gtk.Label("This is a dialog to display additional information")
diff --git a/docs/reference/thunarx-python-property-page-provider.xml b/docs/reference/thunarx-python-property-page-provider.xml
index d58f98d..4f18d3b 100644
--- a/docs/reference/thunarx-python-property-page-provider.xml
+++ b/docs/reference/thunarx-python-property-page-provider.xml
@@ -41,7 +41,12 @@
<title>A Thunarx.PropertyPageProvider plugin</title>
<programlisting>
import hashlib
-import urllib
+
+# A way to get unquote working with python 2 and 3
+try:
+ from urllib import unquote
+except ImportError:
+ from urllib.parse import unquote
from gi.repository import GObject, Gtk, Thunarx
@@ -59,8 +64,8 @@ class ThunarxPropertyPagePlugin(GObject.GObject, Thunarx.PropertyPageProvider):
if file.is_directory():
return
-
- filename = urllib.unquote(file.get_uri()[7:])
+
+ filename = unquote(file.get_uri()[7:])
hbox = Gtk.HBox(0, False)
hbox.show()
@@ -72,7 +77,7 @@ class ThunarxPropertyPagePlugin(GObject.GObject, Thunarx.PropertyPageProvider):
value_label = Gtk.Label()
hbox.pack_start(value_label, True, True, 0)
- md5sum = hashlib.md5(filename).hexdigest()
+ md5sum = hashlib.md5(filename.encode("utf-8")).hexdigest()
value_label.set_text(md5sum)
value_label.show()
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list