Linux - Software This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-11-2009, 10:37 AM
|
#1
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Rep:
|
Where under the HOME dir should Nautilus Python-based extensions be stored?
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))
The file does have execute permissions:
Code:
-rwxrwxr-x 1 brentg brentg 701 2009-04-11 08:14 /home/brentg/.nautilus/python-extensions/block-size-column.py
Could I be missing some type of "dev" package?
Thanks,
bgoodr
|
|
|
04-12-2009, 07:24 PM
|
#2
|
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
|
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
|
|
|
04-14-2009, 11:29 PM
|
#3
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Original Poster
Rep:
|
Quote:
Originally Posted by IBall
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.
bg
|
|
|
04-17-2009, 09:12 AM
|
#4
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Original Poster
Rep:
|
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
|
But that seems to conflict with the Nautilus Installation info I referred to earlier.
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)?
bg
|
|
|
04-17-2009, 09:15 AM
|
#5
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Original Poster
Rep:
|
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.
|
|
|
04-17-2009, 09:21 AM
|
#6
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Original Poster
Rep:
|
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. 
|
|
|
04-17-2009, 09:27 AM
|
#7
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Original Poster
Rep:
|
Found the solution
The python-nautilus package was the missing piece I needed. Now I see the Block Size entry in the View/Visible Columns dialog box.
|
|
|
04-17-2009, 10:54 PM
|
#8
|
Member
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221
Original Poster
Rep:
|
|
|
|
04-18-2009, 03:33 AM
|
#9
|
Senior Member
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088
Rep:
|
Well done. Thanks for posting the solution as well 
|
|
|
All times are GMT -5. The time now is 03:55 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|