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
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
_readpar(filename,
strict=0)
Read IRAF .par file and return list of parameters |
source code
|
|
|
|
_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
|
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.
|
|
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.
|
|
Returns a (possibly empty) list of path names for special versions of
parameter files. This also causes lazy initialization.
|
_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>[^,]*)
,?)')
|
|