Where under the HOME dir should Nautilus Python-based extensions be stored?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I'm running fully up-to-date Debian Testing using GNOME version 2.22.3 and Nautilus version 2.20.0 installed from packages with no customization (yet, that is what I'm trying to do). I want to customize the available columns to include additional file info versus what is currently provided. I thought I would find an example that works and get that working, so I searched and found an example and some Nautilus Installation info stating:
Quote:
Python extensions go in ~/.nautilus/python-extensions or /usr/lib/nautilus/extensions-2.0/python
The example code I found was the block-size-column.py example. I stored the file and gave it execute permissions at ~/.nautilus/python-extensions/block-size-column.py, restarted Nautilus (note I did not restart the entire GNOME window manager ... is that the issue?), and expected to be able to see the new column under the View Menu/Visible Columns dialog, but that did not occur. The content of the file as it stands now is:
Code:
# I _thought" this should go into ~/.nautilus/python-extensions/block-size-column.py
import os
import urllib
import nautilus
class ColumnExtension(nautilus.ColumnProvider, nautilus.InfoProvider):
def __init__(self):
pass
def get_columns(self):
return nautilus.Column("NautilusPython::block_size_column",
"block_size",
"Block size",
"Get the block size"),
def update_file_info(self, file):
if file.get_uri_scheme() != 'file':
return
filename = urllib.unquote(file.get_uri()[7:])
file.add_string_attribute('block_size', str(os.stat(filename).st_blksize))
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Thanked: 4
Maybe try restarting the whole Gnome desktop? (ie: Log out and log back in).
In Gnome, Nautilus is responsible for drawing the desktop icons as well and so closing the nautilus windows and reopening is probably not restarting it.
Maybe try restarting the whole Gnome desktop? (ie: Log out and log back in).
In Gnome, Nautilus is responsible for drawing the desktop icons as well and so closing the nautilus windows and reopening is probably not restarting it.
--Ian
Well, even after a reboot, I don't see a change in the dialogs. Perhaps their documentation is wrong.
I'm still after an answer for this, so more searching revealed an Ubuntu reference that states:
Quote:
All of your scripts are stored in the nautilus-scripts folder - so to add a new script, simply place it there. You can find the nautilus-scripts folder here:
~/.gnome2/nautilus-scripts
I'm wondering if there are two places for scripts: One set that can override things in the View/Visible Columns area of Nautilus (which is what I'm after), and yet another for the context menu on the files (which is not what I'm after, at least, not right now)?
More searching found announcement about Nautilus-python back in 2005 that leads me to conclude that the Python extension mechanism is not built into the Nautilus that is installed by default in GNOME on Debian Testing. But I don't know for sure yet.
The announcement about Nautilus-python led me to search for a Debian package and I found one that might be what I need at python-nautilus. I will try that first and see if I can get some traction.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
Advertisement
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Click Here to receive a complimentary subscription courtesy of LQ.