5 |
|
from crab_exceptions import * |
6 |
|
import common |
7 |
|
|
8 |
< |
import string |
8 |
> |
import string,os |
9 |
|
|
10 |
|
class ScriptWriter: |
11 |
|
def __init__(self, template): |
22 |
|
'register_output' : self.registerOutput_ |
23 |
|
} |
24 |
|
|
25 |
< |
self.template = template |
25 |
> |
if os.path.isfile("./"+template): |
26 |
> |
self.template = "./"+template |
27 |
> |
elif os.getenv('CRABDIR') and os.path.isfile(os.getenv('CRABDIR')+'/python/'+template): |
28 |
> |
self.template = os.getenv('CRABDIR')+'/python/'+template |
29 |
> |
else: |
30 |
> |
raise CrabException("No crab_template.sh found!") |
31 |
|
self.nj = -1 # current job number |
32 |
|
return |
33 |
|
|