ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/LFNBaseName.py
Revision: 1.21
Committed: Fri Mar 6 18:36:30 2009 UTC (16 years, 1 month ago) by spiga
Content type: text/x-python
Branch: MAIN
CVS Tags: CRAB_2_6_0_pre2, CRAB_2_6_0_pre1, CRAB_2_5_1, CRAB_2_5_1_pre4, CRAB_2_5_1_pre3, CRAB_2_5_1_pre2, CRAB_2_5_1_pre1, CRAB_2_5_0, CRAB_2_5_0_pre7, CRAB_2_5_0_pre6
Changes since 1.20: +3 -88 lines
Log Message:
removed not needed methods

File Contents

# User Rev Content
1 afanfani 1.2 #!/usr/bin/env python
2     """
3     _LFNBaseName_
4     """
5    
6     from crab_exceptions import *
7 spiga 1.21 from crab_util import runCommand, getUserName
8 afanfani 1.2 import common
9 afanfani 1.12 import os, string, time
10 afanfani 1.2
11    
12 spiga 1.21 def LFNBase(forced_path, PrimaryDataset='',ProcessedDataset='',merged=True,publish=False):
13 afanfani 1.2 """
14     """
15 fanzago 1.10 if (PrimaryDataset == 'null'):
16     PrimaryDataset = ProcessedDataset
17 spiga 1.20 if PrimaryDataset != '':
18     if ( PrimaryDataset[0] == '/' ): PrimaryDataset=PrimaryDataset[1:]
19 spiga 1.21 lfnbase = os.path.join(forced_path, getUserName(), PrimaryDataset, ProcessedDataset)
20 ewv 1.9
21 afanfani 1.2 return lfnbase
22    
23 afanfani 1.4
24 afanfani 1.2 if __name__ == '__main__' :
25     """
26     """
27     from crab_logger import Logger
28     from WorkSpace import *
29 ewv 1.9 continue_dir = os.path.expanduser("~")
30 afanfani 1.2 cfg_params={'USER.logdir' : continue_dir }
31     common.work_space = WorkSpace(continue_dir, cfg_params)
32     log = Logger()
33     common.logger = log
34    
35 ewv 1.9 print "xx %s xx"%getUserName()
36 afanfani 1.2 baselfn = LFNBase("datasetstring")
37 ewv 1.9 print baselfn
38 afanfani 1.2
39     unmergedlfn = LFNBase("datasetstring",merged=False)
40 ewv 1.9 print unmergedlfn
41 afanfani 1.2 print PFNportion("datasetstring")