Modernize examples#35
Conversation
The example extension scripts need to be in sync with new versions of referenced foreign packages. This commit also makes them compatible with Python version 3 (retaining Python 2 compatibility). An additional example extension "mixed" is added: it implements all caja extension features and can also be used as a new extension pattern. See source header comment for a description. Ref: #34 (comment)
|
How do you use the examples? |
See https://github.com/mate-desktop/python-caja/blob/master/examples/README Personally, in terminal 1: In terminal 2 (as normal user): Don't forget to remove the extension and restart caja as above after finishing working with it ! |
vkareh
left a comment
There was a problem hiding this comment.
This works for me, I have way to many plugins running on caja now :D (I'll remove them)
|
Thanks for merge! |
| return | ||
|
|
||
| self.bgsettings[BACKGROUND_KEY] = file.get_uri() | ||
| self.bgsettings[BACKGROUND_KEY] = self._filepath(file) |
There was a problem hiding this comment.
Hmm... can we just use some other method from GFile to get the filename? It would keep the code simple as before.
Yes we can, although I'm not convinced this is simpler (I've searched several minutes to find this unobvious solution): It also has the advantage of not using urllib. Approved? If yes, I'll submit a PR. |
|
I didn't know it would be more complex in Python. I looked at C API docs, there's g_file_get_path available. No "get_location" function is mentioned. |
In fact, the value is a |
|
Ok, I didn't know it was |

The example extension scripts need to be in sync with new versions of
referenced foreign packages.
This commit also makes them compatible with Python version 3 (retaining
Python 2 compatibility).
An additional example extension "mixed" is added: it implements all caja
extension features and can also be used as a new extension pattern. See
source header comment for a description.
Ref: #34 (comment)
Tested successfully with Fedora 27 x86_64 and Fedora 29 x86_64 with update from PR #34