From f70a9028dd5b2a1ef09bedcf56b59d479da69607 Mon Sep 17 00:00:00 2001 From: Francois Henrotte <francois.henrotte@ulg.ac.be> Date: Thu, 13 Nov 2014 09:16:33 +0000 Subject: [PATCH] path checking class pth --- contrib/onelab/python/onelab.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/contrib/onelab/python/onelab.py b/contrib/onelab/python/onelab.py index 0e7ea24744..44facd54dc 100755 --- a/contrib/onelab/python/onelab.py +++ b/contrib/onelab/python/onelab.py @@ -55,17 +55,15 @@ def path(ref, inp=''): class pth: def path(self, ref, inp=''): - p = path(ref, inp='') - if not os.path.exists(): - print('The path %s does not exist' %(p)) + p = path(ref,inp) + if not os.path.exists(p): + print('PTH error: The path %s does not exist' %(p)) self.errors += 1 return p - def check_file(self, filename, workdir): - if not file_exist(workdir + os.sep + filename): - print('The file %s does not exist in %s' %(filename, workdir)) - self.errors += 1 - + def copy(self, here, there): + os.system('cp '+ here + ' ' + there) + def __init__(self) : self.errors = 0 -- GitLab