Package pyraf :: Module irafpar
[hide private]
[frames] | no frames]

Module irafpar

source code

irafpar.py -- parse IRAF .par files and create lists of IrafPar objects

$Id: irafpar.py 1279 2010-10-08 16:54:02Z sontag $

R. White, 2000 January 7

Classes [hide private]
  IrafParPset
IRAF pset parameter class
  IrafParL
IRAF list parameter base class
  IrafParLS
IRAF string list parameter class
  IrafParCursor
Base class for cursor parameters
  IrafParGCur
IRAF graphics cursor parameter class
  IrafParImCur
IRAF image display cursor parameter class
  IrafParUKey
IRAF user typed key parameter class
  ParCache
Parameter cache that updates from .par file when necessary
  IrafParList
List of Iraf parameters
Functions [hide private]
 
IrafParFactory(fields, strict=0)
IRAF parameter factory fields is a list of the comma-separated fields (as in the .par file).
source code
 
makeIrafPar(init_value, datatype=None, name='<anonymous>', mode='h', array_size=None, list_flag=0, min=None, max=None, enum=None, prompt='', strict=0, filename=None)
Create an IrafPar variable
source code
 
_printVerboseDiff(list1, list2)
Print description of differences between parameter lists
source code
 
_extractDiffInfo(list) source code
 
_printHiddenDiff(pd1, hd1, pd2, hd2) source code
 
_printDiff(pd1, pd2, label) source code
 
_updateSpecialParFileDict(dirToCheck=None, strict=False)
Search the disk in the given path (or .) for special-purpose parameter files.
source code
 
newSpecialParFile(taskName, pkgName, pathName)
Someone has just created a new one and we are being notified of that fact so that we can update the dict.
source code
 
haveSpecialVersions(taskName, pkgName)
This is a simple check to see if special-purpose parameter files have been found for the given task/package.
source code
 
getSpecialVersionFiles(taskName, pkgName)
Returns a (possibly empty) list of path names for special versions of parameter files.
source code
 
_readpar(filename, strict=0)
Read IRAF .par file and return list of parameters
source code
Variables [hide private]
  _string_list_types = ('*struct', '*s', '*f', '*i')
  _typedict = {'bool': 'b', 'char': 's', 'double': 'd', 'file': ...
  _specialUseParFileDict = None
  _re_taskmeta = re.compile(r'^# *TASKMETA *: *task *= *([^ ]*) ...
  _re_field = re.compile(r'(?s)(?:[ \t]*(?P<comma>$|(?=,)|(?:[^,...
  _re_bstrail = re.compile(r'\\*$')
  __package__ = 'pyraf'

Imports: copy, glob, os, re, sys, types, basicpar, minmatch, irafutils, taskpars, INDEF, Verbose, yes, no, warning, _StringMixin, IrafPar, IrafParS, _cmdlineFlag, IrafParB, IrafParI, IrafParR, IrafParAB, IrafParAI, IrafParAR, IrafParAS, irafimcur, irafukey, epar, tpar, gki, iraf, FileCache


Function Details [hide private]

IrafParFactory(fields, strict=0)

source code 

IRAF parameter factory fields is a list of the comma-separated fields (as in the .par file). Each entry is a string or None (indicating that field was omitted.) Set the strict parameter to a non-zero value to do stricter parsing (to find errors in the input.)

_updateSpecialParFileDict(dirToCheck=None, strict=False)

source code 

Search the disk in the given path (or .) for special-purpose parameter files. These can have any name, end in .par, and have metadata comments which identify their associated task. This function simply fills or adds to our _specialUseParFileDict dictionary. If strict is True then any .par file found is expected to have our TASKMETA tag.

haveSpecialVersions(taskName, pkgName)

source code 

This is a simple check to see if special-purpose parameter files have been found for the given task/package. This returns True or False. If the dictionary has not been created yet, this initializes it. Note that this may take some time reading the disk.

getSpecialVersionFiles(taskName, pkgName)

source code 

Returns a (possibly empty) list of path names for special versions of parameter files. This also causes lazy initialization.


Variables Details [hide private]

_typedict

Value:
{'bool': 'b',
 'char': 's',
 'double': 'd',
 'file': 'f',
 'gcur': 'gcur',
 'imcur': 'imcur',
 'int': 'i',
 'pset': 'pset',
...

_re_taskmeta

Value:
re.compile(r'^# *TASKMETA *: *task *= *([^ ]*) *package *= *([^ \n]*)'\
)

_re_field

Value:
re.compile(r'(?s)(?:[ \t]*(?P<comma>$|(?=,)|(?:[^, \t\'"][^,]*)),?)|(?\
:[ \t]*"(?P<double>[^"\\]*(?:\\.[^"\\]*)*)"[ \t]*(?P<djunk>[^,]*),?)|(\
?:[ \t]*\'(?P<single>[^\'\\]*(?:\\.[^\'\\]*)*)\'[ \t]*(?P<sjunk>[^,]*)\
,?)')