Logo Search packages:      
Sourcecode: catfish version File versions  Download package

def catfish::catfish::open_file (   self,
  filename 
)
Open the file with its default app or the file manager

Definition at line 479 of file catfish.py.

                                 :
        """Open the file with its default app or the file manager"""

        try:
            if stat.S_ISDIR(os.stat(filename).st_mode):
                command = [self.options.fileman, filename]
            else:
                command = [self.open_wrapper, filename]
            try:
                subprocess.Popen(command, shell=False)
            except Exception, msg:
                if self.options.debug: print 'Debug:', msg
                self.get_error_dialog(('Error: Could not open the file %s.'
                 % filename), self.window_search)
                print '* The wrapper was %s.' % self.open_wrapper
                print '* The filemanager was %s.' % self.options.fileman
                print 'Hint: Check wether the wrapper and filemanager exist.'
        except Exception, msg:
            if self.options.debug: print 'Debug:', msg
            self.get_error_dialog(('Error: Could not access the file %s.'
             % filename), self.window_search)


Generated by  Doxygen 1.6.0   Back to index