chooseviewer.py - choose a program
for viewing a file, based either on the filename.extension, or
by an extension supplied on the command line
filename - The first
argument
must be the name of the file to view. If the file
name has a file extension, the file extension is used to identify
the type of file, and then open the appropriate viewer. If no file
extension is found or the extension is uninformative (eg. .out,
.tmp), the default is to open the file in a text editor. If the
document is not a plain text, use the --ext option to specify the
type of file. (See EXAMPLES below)
Type of file
|
valid file extensions
|
example of viewer
|
Web document
|
html, shtml, htm
|
Firefox
|
Portable Document Format
|
pdf
|
Adobe Reader
|
PostScript
|
ps, eps
|
evince
|
Spreadsheet
|
xls, xlsx, ods, sxc, csv, tsv, dif, dbf
|
LibreOffice Calc
|
Document
|
odt, sxw, doc, docx, rtf
|
LibreOffice Writer
|
Bitmap graphic image
|
gif, jpg, jpeg, png, bmp, tif, tiff
|
Eyes of Gnome
|
Text
|
no extension, or none in the list of valid
extensions
|
Nedit
|
--ext extension - Any valid file extension. File
extensions may be in upper, lower or mixed case. This parameter
overrides any file extension included as part of the
filename.
--delete - After the viewer has opened, delete the file.
The main purpose of this option is to give BioLegato more
flexibility in when to delete temporary output files. For
obvious reasons, --delete only works on files on the local
filesystem. If the filename begins with http:, https:, ftp:, or
ftps:, it is assumed to be a URL, and no attempt is made to delete
the file.
--wait - Wait for the viewer to terminate before
terminating chooseviewer.py. By default, chooseviewer.py runs the
process in the background in a separate fork. If we didn't do
this,programs like BioLegato or ACEDB couldn't get on with what
they're doing, or terminate, until the child process terminates.
However, --wait can be used if for some reason you don't want to
run the viewer in the background.