gcmd-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gcmd-dev] Python plugins


From: Micha
Subject: Re: [gcmd-dev] Python plugins
Date: Sun, 10 Dec 2006 01:54:14 +0100
User-agent: Alpenglühn 7.2


Huh ?

Traceback (most recent call last):
  File "sample-plugin.py", line 16, in main
    f = file.open(fname,'rb')
AttributeError: type object 'file' has no attribute 'open'

for:

#!/usr/bin/env python
        
try:
       import gnomevfs
       
except ImportError:
       import gnome.vfs as gnomevfs
       
import md5
       

def main(main_wnd_xid, active_cwd, inactive_cwd,selected_files):

    for uri in selected_files:
        fname = gnomevfs.get_file_info(uri).name
        f = file.open(fname,'rb')
        file_content = f.read()
        f.close()
        md5sum = md5.new(file_content).hexdigest()
        print md5sum, fname
    return True



...how can i check if the import was successful ?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]