Commit 480601228a4414d954100761ee22d7f79ad41b3d

Authored by Jürgen Knödlseder
1 parent 71cb5264

Adapt to new GApplicationPar::filename() method returning a GFilename object.

Showing 1 changed file with 6 additions and 7 deletions
cscripts/csiactcopy.py
... ... @@ -104,7 +104,6 @@ class csiactcopy(ctools.cscript):
104 104  
105 105 # Get Parameters
106 106 self.m_remote_master = self["remote_master"].filename()
107   - #if not os.path.isfile(self.m_remote_master):
108 107 if not self.m_remote_master.exists():
109 108 raise RuntimeError("*** ERROR: FITS data not available. No master index file found in \""+self.m_remote_master.url()+"\". Make sure remote file system is properly mounted")
110 109  
... ... @@ -182,20 +181,20 @@ class csiactcopy(ctools.cscript):
182 181 raise RuntimeError("*** ERROR: Runlist file \""+self.m_runlist+"\" not available")
183 182  
184 183 # Check for availability of remote master file
185   - if not os.path.isfile(self.m_remote_master):
186   - raise RuntimeError("*** ERROR: Remote master file \""+self.m_remote_master+"\" does not exist")
  184 + if not self.m_remote_master.exists():
  185 + raise RuntimeError("*** ERROR: Remote master file \""+self.m_remote_master.url()+"\" does not exist")
187 186  
188 187 # Retrieve json data from remote master
189   - json_data = open(self.m_remote_master).read()
  188 + json_data = open(self.m_remote_master.url()).read()
190 189 data = json.loads(json_data)
191 190 if not "datasets" in data:
192   - raise RuntimeError("*** ERROR: Key \"datasets\" not available in remote master index file \""+self.m_remote_master+"\".")
  191 + raise RuntimeError("*** ERROR: Key \"datasets\" not available in remote master index file \""+self.m_remote_master.url()+"\".")
193 192  
194 193 # Get array of configurations
195 194 configs = data["datasets"]
196 195  
197 196 # Get remote paths
198   - self.remote_base = os.path.dirname(self.m_remote_master)
  197 + self.remote_base = os.path.dirname(self.m_remote_master.url())
199 198  
200 199 # Initialise flag if prod has been found
201 200 has_prod = False
... ... @@ -427,7 +426,7 @@ class csiactcopy(ctools.cscript):
427 426  
428 427 # If no local master is found, copy master over first
429 428 if not os.path.isfile(localmaster):
430   - self.copy(self.m_remote_master, self.clobber())
  429 + self.copy(self.m_remote_master.url(), self.clobber())
431 430  
432 431 # Load local master
433 432 json_data = open(localmaster).read()
... ...