Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/obset_util.html
Дата изменения: Fri Apr 8 12:46:15 2016
Дата индексирования: Mon Apr 11 00:39:03 2016
Кодировка:

Поисковые слова: столовая гора
Python: module obset_util
 
 
obset_util (version 8/19/15)
index
obset_util.py

PURPOSE --
A module for dealing with obsets
 
DEVELOPER --
Don Chance
 
MODIFICATION HISTORY --
- Initial implementation 12/1/99
 
- Beefed up obset constructor to take many more types of input. drc 5/11/00
 
- Updated the obset constructor to copy another obset object in
  a more general fashion.  drc 6/26/00
 
- Added obset_list class.   GWW 07/21/00
 
- Enhanced obset_list class.  drc 7/26/01
 
- Fix add method for obset_list.  drc 11/14/01
 
- Fix obset_list constructor.  drc 12/4/01
 
- Make sure obset_id is upper case. drc 12/4/01
 
- Added get_proposal function.  drc 2/18/04
 
- Added sunit_id field recognition app 5/28/04
 
- Added get_opmode and get_alignments functions. drc 9/30/04
 
- Added get_qbwindows function and embellished handling of "select *"
  queries in same manner as su_util  dpj 8/19/15

 
Modules
       
exceptions
os
proposal_util
spss_sys_util
stpydb
string
su_util
time_util
types

 
Classes
       
exceptions.RuntimeError(exceptions.StandardError)
FailedObsetUpdate
obset
obset_list

 
class FailedObsetUpdate(exceptions.RuntimeError)
    The error raised when pmdb -update fails.
 
 
Method resolution order:
FailedObsetUpdate
exceptions.RuntimeError
exceptions.StandardError
exceptions.Exception
exceptions.BaseException
__builtin__.object

Data descriptors defined here:
__weakref__
list of weak references to the object (if defined)

Methods inherited from exceptions.RuntimeError:
__init__(...)
x.__init__(...) initializes x; see help(type(x)) for signature

Data and other attributes inherited from exceptions.RuntimeError:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from exceptions.BaseException:
__delattr__(...)
x.__delattr__('name') <==> del x.name
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__reduce__(...)
__repr__(...)
x.__repr__() <==> repr(x)
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
__setstate__(...)
__str__(...)
x.__str__() <==> str(x)
__unicode__(...)

Data descriptors inherited from exceptions.BaseException:
__dict__
args
message

 
class obset
    A class for obsets.
 
  Methods defined here:
__cmp__(self, other)
Compare two obsets.
 
If 'other' is a string, assume it is an obset id in the form
ppppp:oo, otherwise 'other' must be an obset object.  A 'TypeError'
will be raised if 'other' is neither of these.
__init__(self, proposal, obset_id=None, version_num='01', data=None)
The obset object constructor.
 
The constructor will work with proposal, obset, and version given in
several forms:
      - proposal = a list or tuple of form ('ppppp', 'oo'[, 'vv'])
      - proposal = a list or tuple of form ('ppppp:oo[:vv]')
      - proposal = a list or tuple of form (proposal_object, 'oo'[, 'vv'])
      - proposal = a string of form 'ppppp:oo[:vv]'
      - proposal = a string or int of form 'ppppp', obset_id = a string of form 'oo',
                   [version_num = a string of form 'vv']
      - proposal = a proposal object, obset_id = a string of form 'oo',
                   [version_num = a string of form 'vv']
      - proposal = another obset object
The version numbers is always optional and defaults to '01'.
An optional data dictionary of obset data may also be
input to the constructor in all cases.  Also note, the proposal is not required
to be 5 characters long; it will be left padded with zeros by proposal_util if
it is less than 5 characters long.
__repr__(self)
get(self, field)
Returns the value of 'field'.
 
The value of 'field' will be retrieved from the PMDB if necessary.
If the field is 'proposal', the proposal object associated with this
obset is returned.
If 'field' is not already in the internal dictionary and is not
found in a relation in the db, None will be returned.
get_alignments(self)
Return a list of the alignment objects for this obset.
get_opmode(self, config)
Retrieve the opmodes of the input configurations.
get_proposal(self)
Return the proposal object for this obset.
get_qbwindows(self, win_type='ALL')
Retrieve records from the QBWINDOWS database relation for this
obset.
 
A nested list of values will be returned.  Each inner list will
contain one row from the database with the fields in the 
following order: 
    [<window_type>,<critic_flg>,<window_beg>,<window_end>]
<window_beg> and <window_end> will be returned as 
time_util.spss_time objects.
            
The inner lists will be sorted by window_type as the primary
key.  The secondary keys are window_beg and window_end.
 
The caller can specify one specific window type through the 
parameter.  If the parameter is not specified, all window types
will be returned.
 
If no QBWINDOWS records exist for this obset, an empty list is
returned.
has_field(self, field)
Check the object for the existence of 'field' in its internal dictionary.
 
Returns TRUE if it is there, FALSE otherwise.
has_key(self, field)
set(self, field, value)
Set a 'field' to a 'value'.
update(self)
Execute a pmdb/update for this obset.
 
Returns the status flag from the pmdb -update.

Data and other attributes defined here:
conversion = {'parallel_can': None, 'reacq_tm_nsl': None, 'sunit_id': None, 'target_opp': None}
conversion_imports = []
relation = {'parallel_can': 'qbs_obset', 'reacq_tm_nsl': 'qbs_obset', 'sunit_id': 'qsbranching', 'target_opp': 'qbs_obset'}

 
class obset_list
    A class for lists of obset objects.
 
  Methods defined here:
__add__(self, other)
__getitem__(self, offset)
__getslice__(self, low, high)
__init__(self, obsetlist=None)
The obset_list constructor.
__len__(self)
__repr__(self)
equals(self, other)
Checks if 'self' and 'other' are the same.
list_repr(self)
Returns an ordinary list of strings, each string being the name
of an obset.
update(self, verbose=1)
Performs a pmdb update on all obsets in obset_list.

 
Functions
       
which_db(field)

 
Data
        FALSE = 0
False = 0
TRUE = 1
True = 1
__version__ = '8/19/15'
false = 0
true = 1