Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.stsci.edu/spst/UnixTransition/doc/dan_util.html
Дата изменения: Fri Apr 8 12:46:14 2016
Дата индексирования: Sun Apr 10 23:18:31 2016
Кодировка:
Python: module dan_util
 
 
dan_util (version 16.01.13)
index
dan_util.py

PURPOSE --
A module for dealing with JWST DAN messages.
 
DEVELOPER --
Don Chance
 
MODIFICATION HISTORY --
 
o Initial implementaion 11/26/13

 
Modules
       
xml.etree.ElementTree
binascii
copy
jwst_time_util
logging
os
shutil
spss_sys_util
urllib

 
Classes
       
spss_logging_util.Logger(__builtin__.object)
dan_base
dan_parser
dan_product_file
DSNContact_product
OSF_product
PredictEph_product
skManeuver_product
dan_builder

 
class DSNContact_product(dan_product_file)
    
Method resolution order:
DSNContact_product
dan_product_file
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
process(self, replace=False)

Methods inherited from dan_product_file:
__init__(self, path, url, product_type, size, checksum, logfile, logging_level, email)
archive(self, dan_env='ops')
check_checksum(self)
Check the calculated CRC32 checksum against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.
check_size(self)
Check the file size against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.

Methods inherited from dan_base:
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class OSF_product(dan_product_file)
    
Method resolution order:
OSF_product
dan_product_file
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
process(self, baseline='')

Methods inherited from dan_product_file:
__init__(self, path, url, product_type, size, checksum, logfile, logging_level, email)
archive(self, dan_env='ops')
check_checksum(self)
Check the calculated CRC32 checksum against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.
check_size(self)
Check the file size against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.

Methods inherited from dan_base:
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class PredictEph_product(dan_product_file)
    
Method resolution order:
PredictEph_product
dan_product_file
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
process(self, replace=False)

Methods inherited from dan_product_file:
__init__(self, path, url, product_type, size, checksum, logfile, logging_level, email)
archive(self, dan_env='ops')
check_checksum(self)
Check the calculated CRC32 checksum against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.
check_size(self)
Check the file size against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.

Methods inherited from dan_base:
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class dan_base(spss_logging_util.Logger)
    
Method resolution order:
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
__init__(self, logfile=None, logging_level=20, email=None)
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class dan_builder(spss_logging_util.Logger)
    A class for the construction of a new DAN file.
 
 
Method resolution order:
dan_builder
spss_logging_util.Logger
__builtin__.object

Methods defined here:
__init__(self, product_id, source_id='PPS', dest_id='FOS', scheme='sftp', logfile=None, logging_level=20, dist=None)
add_file(self, path, filetype='')
get_danid(self)
get_filename(self)
get_scheme(self)
set_component(self, component)
set_danid(self, danid=None)
Set the dan id the input number or to system seconds if no value is
passed in.
set_datetime(self, time=None)
set_env(self, dan_env)
set_filename(self, filename=None)
set_recipient(self, recipient)
set_return_url(self, return_url)
set_scheme(self, scheme)
write(self, filename=None)

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class dan_parser(dan_base)
    Parse an input DAN.
 
 
Method resolution order:
dan_parser
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
__init__(self, dan='', sftp=None, logfile=None, logging_level=20, email=None)
archive(self)
Move the DAN (and DAN ACK) to the archive directory.
rdel(self, remote_dan_path)
Delete the DAN from the server.
retrieve_files(self)
Retrieve the files listed in the DAN.
 
Returns a list of the retrieve file paths.
 
Update the DAN_ACK XML accordingly.
return_dan_ack(self)
Send back the DAN_ACK XML file.
write_ack(self, filename='')
Write the DAN_ACK XML to a file.

Methods inherited from dan_base:
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class dan_product_file(dan_base)
    
Method resolution order:
dan_product_file
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
__init__(self, path, url, product_type, size, checksum, logfile, logging_level, email)
archive(self, dan_env='ops')
check_checksum(self)
Check the calculated CRC32 checksum against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.
check_size(self)
Check the file size against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.
process(self)

Methods inherited from dan_base:
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
class skManeuver_product(dan_product_file)
    
Method resolution order:
skManeuver_product
dan_product_file
dan_base
spss_logging_util.Logger
__builtin__.object

Methods defined here:
process(self)

Methods inherited from dan_product_file:
__init__(self, path, url, product_type, size, checksum, logfile, logging_level, email)
archive(self, dan_env='ops')
check_checksum(self)
Check the calculated CRC32 checksum against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.
check_size(self)
Check the file size against that provided by the DAN.
 
Returns True if the check passes.  Otherwise, returns False.

Methods inherited from dan_base:
validate(self, prd_name=None, override_name='NONE', dbserver='', dbname='', sql_schema='')
Validate this DAN against the DAN schema from the PPSDB.

Data descriptors inherited from spss_logging_util.Logger:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
CRC32_from_file(filename)
Compute the cyclic redundancy check for the input file.
dan_product_factory(localpath, url, product_type='', size=0, checksum=0, logfile=None, logging_level=20)
parse_file_spec(element)
Parse the FILE_SPEC subelement from a DAN.
 
Returns a tuple of URL, TYPE, SIZE, CHECKSUM.
path_to_url(scheme, path)
url_to_path(url)

 
Data
        DAN_ENV = ['TEST', 'DEV', 'OPS']
DAN_ENV_DICT = {'develop': 'DEV', 'operational': 'OPS', 'test': 'TEST'}
DAN_PRODUCT_PATHS = {'DSNContact': 'fosToPps/dsnContact', 'OSF': 'fosToPps/osf', 'PredictEph': 'fosToPps/predictEph', 'skManeuver': 'fosToPps/skManeuver'}
DAN_RECEIVE_DIR = '/data/jwst/scheduling/dan/received'
DAN_SEND_DIR = '/data/jwst/scheduling/dan/sent'
DAN_SERVER = 'yoda.stsci.edu'
DAN_SERVER_ACCOUNT = 'chance'
DAN_TEMPLATE = '<?xml version="1.0" encoding="UTF-8"?>\n<DAN dan_...P>true</RECIPIENT_OWNERSHIP>\n </FILES>\n</DAN>\n'
DAN_TIME_FORMAT = '%Y-%j/%H:%M:%S'
__version__ = '16.01.13'