Table of Contents

Module: Format Bio/Format.py

Define a Format for the Bioformats projects.

These are the allowed fields.

  • name -- the primary, canonical name for the format (required)

This is the externally visible string that people should use. It must be unique. The grammer for a name is not yet written formalized, but here are some examples:

swissprot swissprot/38 pdb-generic pdb-generic/2.1 pdb/XPLOR-3.1

  • abbrev -- an abbreviated name used internally (optional)

This value should not be visible to most people. It is used as part of the resolution system to find builders, converters, and writers without having to define everything at the beginning. The abbrev name must be usable as a Python module name, which means it must be of the form: [a-zA-Z_][a-zA-Z0-9_]*

If not given, the name is used.

  • expression -- Martel expression to parse the format (optional)

An expression need to be defined at the bottom-most level of the recognition tree.

  • filter -- Martel expression to test if the format matches (optional)

The object needs to support the make_parser method. The created parser is tested against the input text. If the parse is successful, or generates a ParserIncompleteException, then the expression is said to accept the text.

The filter must not accept empty input.

If not given, expression is used.

  • multirecord -- specifies if the format returns more than one record (optional)

Some formats contain a single record, others returns a list of records. Different parts of the API change to handle these as expected. This value should be 0 or 1. The default is 1, which means there may be more than one record in the file.

  • description -- free form text which describes this format (optional)

== These fields concern the original provider of the format This may have nothing to do with the Bioformats format definition.

  • provider_url -- URL for the site providing the format (optional) Example: http://www.expasy.ch/

  • provider_doc -- URL for the primary documentation on the format (optional) Example: http://www.expasy.ch/sprot/userman.html

There may not be a permanent URL for all versions of a given documentation. Use the site you think is the most appropriate.

== These fields concern the people who wrote this definition

  • author_name -- name of the person who wrote this definition (optional) Example: Andrew Dalke

(The name may be of a person, organization, non-corporeal being, etc.)

  • author_email -- email address of the person who wrote this definition (optional) Example: dalke@dalkescientific.com

  • author_url -- URL for the person who wrote this definition (optional)

In case you want people to know more about you.

== These fields concern the people who wrote this definition

The intent is to allow the author fields to contain information about the person who wrote the definition, and the maintainer fields to contain information about who to bug when things go wrong. They may be different people. It may even be that the author is a person in a company, and the company is listed as the maintainer.

  • maintainer_name -- name of the person who maintains the definition (optional)

If not given, the default is the same as the author_name

  • maintainer_email -- email address of the person who maintains the definition (optional)

If not given, the default is the same as the author_email

  • maintainer_url -- URL for whoever wrote this format definition (optional) Example: http://www.dalkescientific.com/

If not given, the default is the same as author_url.

Imported modules   
import Martel
from Martel import Parser
import ReseekFile
import StdHandler
import _FmtUtils
import re
import sys
import urllib
from xml.sax import handler, saxutils
Functions   
_Trace
_build_child_path
_build_parent_path
_parse_docstring
check_parser_file
check_parser_string
  _Trace 
_Trace ( trace )

  _build_child_path 
_build_child_path (
        format,
        visited,
        format_list,
        )

  _build_parent_path 
_build_parent_path (
        format,
        visited,
        format_list,
        )

  _parse_docstring 
_parse_docstring ()

Exceptions   
TypeError("Incorrect format: %r" %( line, ) )
  check_parser_file 
check_parser_file (
        expression,
        infile,
        trace,
        debug_level,
        )

  check_parser_string 
check_parser_string (
        expression,
        s,
        trace,
        debug_level,
        )

Classes   
Format
FormatDef
FormatGroup
Trace

Table of Contents

This document was automatically generated on Mon Jul 1 12:02:43 2002 by HappyDoc version 2.0.1