Package helpers :: Module UpdateFitsFileNames :: Class UpdateFits
[hide private]

Class UpdateFits

source code


Updates fileName and catName in the given databases.

Instance Methods [hide private]
 
__init__(self, cli)
Initialise class from command-line options.
source code
dict(int:list(str))
getFileNames(self, archive)
Get a list of all MultiframeIds, filenames, and catnames.
source code
 
run(self)
Update the prepared list of databases.
source code
str
updateFromArgs(self, oldFileName, dateVersStr, updateMask)
Update the given file name from arguments.
source code
 
updateFromFile(self)
Create the dictionary containing old/new path relations from a file.
source code
 
updater(self, database)
Update the given database.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  dateVersStr = '20050101'
Date and version dirname of the data.
  deprecateFiles = False
Set the deprecated flag.
  isTrialRun = False
Don't update just print statements?
  newDisk = ''
Disk where data has been moved to.
  outDir = 'ingest/fits'
Sub-directory containing the new data.
  subDir = 'ingest/fits'
Sub-directory containing the old data.
  updateFileName = None
File containing 'old,new' path pairs.
  updateVersion = ''
Version change 'old=>new'
  userName = 'ldservro'
Database user name.
  _databases = []
List of full-paths to databases to update.
  _updateFileDict = {}
Dictionary containing file info.
  _updateMask = {'avail': None, 'disk': None, 'subdir': None, 'v...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, cli)
(Constructor)

source code 

Initialise class from command-line options.

Parameters:
  • cli (CLI) - Command-line arguments.
Overrides: object.__init__

getFileNames(self, archive)

source code 

Get a list of all MultiframeIds, filenames, and catnames.

Parameters:
  • archive (DbSession) - Connection to database to query.
Returns: dict(int:list(str))
Dictionary giving fileName, catName tuples for every MfID.

updateFromArgs(self, oldFileName, dateVersStr, updateMask)

source code 

Update the given file name from arguments.

Parameters:
  • oldFileName (str) - Old file name.
  • dateVersStr (str) - Date-version string.
  • updateMask (dict(str:list(str))) - Update mask to use.
Returns: str
New file name.

updater(self, database)

source code 

Update the given database.

Parameters:
  • database (str) - Database to update.

Class Variable Details [hide private]

_updateMask

Value:
{'avail': None, 'disk': None, 'subdir': None, 'version': None}