#!/usr/bin/env python
#
# This file sets up and runs a SAM project.
#
import os, sys, string, time, signal
from re import *
from globals import *
import run_project

############################################################################
#
#  Set the following variables to appropriate values

# Consult database for valid choices
sam_station        = "central-analysis"

# Consult Database for valid choices
project_definition = "data_reco_all_124137"

# A particular snapshot version, last or new
snapshot_version   = 'new'

# Consult database for valid choices
appname            = "test"
version            = "1"
group              = "dzero"


# The maximum number of files to get from sam
max_file_amt       = 160

# for additional debug info use "--verbose"
##verbosity          = "--verbose"
verbosity           = ""

# Give up on all exceptions
give_up            = 1


def file_ready(filename):
    # Replace this python subroutine with whatever you want to do
    # to process the file that was retrieved.
    # Your program will only be called in the event of
    # a successful delivery.
    #

    print 'Transferring file: '
    print filename
    print ' to commissioning disk 808.'
    os.system('ls -l %s'%filename)
#   os.system('ln -s %s  .; sleep 1 &'%filename)
    os.system('cp %s /scratch7/deliot/. '%filename)
    #time.sleep(10)
    return




