LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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

Reply
 
Search this Thread
Old 04-11-2009, 10:37 AM   #1
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Rep: Reputation: 36
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
 
Old 04-12-2009, 07:24 PM   #2
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
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
 
Old 04-14-2009, 11:29 PM   #3
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by IBall View Post
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
 
Old 04-17-2009, 09:12 AM   #4
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
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
 
Old 04-17-2009, 09:15 AM   #5
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
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.
 
Old 04-17-2009, 09:21 AM   #6
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
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.
 
Old 04-17-2009, 09:27 AM   #7
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
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.
 
Old 04-17-2009, 10:54 PM   #8
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[45] {x86,x86_64}, Debian "testing" {x86,x86_64}
Posts: 219

Original Poster
Rep: Reputation: 36
See also the GNOME Support Forum post.
 
Old 04-18-2009, 03:33 AM   #9
IBall
Senior Member
 
Registered: Nov 2003
Location: Perth, Western Australia
Distribution: Ubuntu, Debian, Various using VMWare
Posts: 2,088

Rep: Reputation: 61
Well done. Thanks for posting the solution as well
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't find .ssh dir in home dir bobby953 Linux - Newbie 5 03-09-2009 04:00 AM
Removing a Specific Dir From All /home Dir carlosinfl Linux - General 4 06-09-2008 01:08 PM
What is stored in /home? Vulpus Linux - Newbie 5 06-17-2006 07:23 AM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
/home dir with nautilus wont open properly tryinlinux Linux - Software 0 11-06-2003 01:26 PM


All times are GMT -5. The time now is 07:30 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration