test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions | Variables
uploads Namespace Reference

Classes

class  output
 
class  uploader
 

Functions

def friendly_since
 
def log
 
def new_log_file_id
 

Variables

tuple upload_controller = uploader(**upload_metadata)
 
tuple upload_metadata = parse_arguments()
 
dictionary upload_metadata_argument = {}
 

Function Documentation

def uploads.friendly_since (   time_type,
  since 
)
Takes a since and, if it is Run-based expressed as Lumi-based, returns the run number.
Otherwise, returns the since without transformations.

Definition at line 28 of file uploads.py.

Referenced by uploads.uploader.filter_iovs_by_fcsr().

28 
29 def friendly_since(time_type, since):
30  """
31  Takes a since and, if it is Run-based expressed as Lumi-based, returns the run number.
32  Otherwise, returns the since without transformations.
33  """
34  if time_type == "Run" and (since & 0xffffff) == 0:
35  return since >> 32
36  else:
37  return since
38 
# this is simple, and works for now - if logging requirements change, I will write a logging class to manage logging
def friendly_since
Definition: uploads.py:28
def uploads.log (   file_handle,
  message 
)
Very simple logging function, used by output class.

Definition at line 39 of file uploads.py.

References utils.to_timestamp().

Referenced by uploads.output.write().

39 
40 def log(file_handle, message):
41  """
42  Very simple logging function, used by output class.
43  """
44  file_handle.write("[%s] %s\n" % (to_timestamp(datetime.now()), message))
def to_timestamp
Definition: utils.py:6
def log
Definition: uploads.py:39
def uploads.new_log_file_id ( )
Find a new client-side log file name.

Note: This cannot use the upload session token since logs need to be written before this is opened.
However, this can be changed so that the filename that uses the token is written to once
it is obtained.

Definition at line 45 of file uploads.py.

References alcazmumu_cfi.filter.

45 
46 def new_log_file_id():
47  """
48  Find a new client-side log file name.
49 
50  Note: This cannot use the upload session token since logs need to be written before this is opened.
51  However, this can be changed so that the filename that uses the token is written to once
52  it is obtained.
53  """
54  # new id = number of log files + 1
55  # (primitive - matching the hash of the upload session may be a better idea)
56  log_files = filter(lambda file : "upload_log" in file,
57  os.listdir(os.path.join(os.getcwd(), "upload_logs"))
58  )
59  new_id = len(log_files)+1
60  return new_id
def new_log_file_id
Definition: uploads.py:45

Variable Documentation

tuple uploads.upload_controller = uploader(**upload_metadata)

Definition at line 766 of file uploads.py.

tuple uploads.upload_metadata = parse_arguments()

Definition at line 754 of file uploads.py.

dictionary uploads.upload_metadata_argument = {}

Definition at line 759 of file uploads.py.