Package Gnumed :: Package pycommon :: Module gmMimeLib |
[frames] | no frames]

# Module gmMimeLib

source code

This module encapsulates mime operations.

Version: $Revision: 1.27 $

Author: Karsten Hilbert <Karsten.Hilbert@gmx.net>

License: GPL

Functions
guess_mimetype(aFileName=None) Guess mime type of arbitrary file. | source code
get_viewer_cmd(aMimeType=None, aFileName=None, aToken=None) Return command for viewer for this mime type complete with this file | source code
get_editor_cmd(mimetype=None, filename=None) | source code
guess_ext_by_mimetype(mimetype=`'````'`) Return file extension based on what the OS thinks a file of this mimetype should end in. | source code
guess_ext_for_file(aFile=None) | source code
convert_file(filename=None, target_mime=None, target_filename=None, target_extension=None) Convert file from one format into another. | source code
call_viewer_on_file(aFile=None, block=None) Try to find an appropriate viewer with all tricks and call it. | source code

Variables
| open_cmds = ``{``'``exo-open``'``:` `'``exo-open "%s"``'``,` `'``gnome-open``'``:` `'``gnome``...``
| __package__ = ``'``Gnumed.pycommon``'``

Imports: sys, os, mailcap, mimetypes, subprocess, shutil, logging, gmShellAPI, gmTools, gmCfg2

Function Details

### guess_mimetype(aFileName=None) | source code
Guess mime type of arbitrary file. filenames are supposed to be in Unicode

### convert_file(filename=None, target_mime=None, target_filename=None, target_extension=None) | source code
Convert file from one format into another. target_mime: a mime type

### call_viewer_on_file(aFile=None, block=None) | source code
Try to find an appropriate viewer with all tricks and call it. block: try to detach from viewer or not, None means to use mailcap default

Variables Details

  ### open_cmds Value:
      {'exo-open': 'exo-open "%s"',
       'gnome-open': 'gnome-open "%s"',
       'kfmclient': 'kfmclient exec "%s"',
       'op': 'op "%s"',
       'open': 'open "%s"',
       'xdg-open': 'xdg-open "%s"'}