casaconfig 1.2.0__tar.gz → 1.3.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {casaconfig-1.2.0/casaconfig.egg-info → casaconfig-1.3.1}/PKG-INFO +1 -1
  2. casaconfig-1.3.1/casaconfig/private/measures_available.py +91 -0
  3. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/measures_update.py +64 -65
  4. {casaconfig-1.2.0 → casaconfig-1.3.1/casaconfig.egg-info}/PKG-INFO +1 -1
  5. {casaconfig-1.2.0 → casaconfig-1.3.1}/pyproject.toml +1 -1
  6. casaconfig-1.2.0/casaconfig/private/measures_available.py +0 -66
  7. {casaconfig-1.2.0 → casaconfig-1.3.1}/LICENSE +0 -0
  8. {casaconfig-1.2.0 → casaconfig-1.3.1}/MANIFEST.in +0 -0
  9. {casaconfig-1.2.0 → casaconfig-1.3.1}/README.md +0 -0
  10. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/__init__.py +0 -0
  11. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/__main__.py +0 -0
  12. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/config.py +0 -0
  13. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/CasaconfigErrors.py +0 -0
  14. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/__init__.py +0 -0
  15. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/casasiteconfig_example.py +0 -0
  16. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/config_defaults.py +0 -0
  17. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/config_defaults_static.py +0 -0
  18. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/data_available.py +0 -0
  19. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/data_update.py +0 -0
  20. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/do_auto_updates.py +0 -0
  21. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/do_pull_data.py +0 -0
  22. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/get_argparser.py +0 -0
  23. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/get_config.py +0 -0
  24. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/get_data_info.py +0 -0
  25. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/get_data_lock.py +0 -0
  26. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/have_network.py +0 -0
  27. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/io_redirect.py +0 -0
  28. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/print_log_messages.py +0 -0
  29. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/pull_data.py +0 -0
  30. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/read_readme.py +0 -0
  31. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/set_casacore_path.py +0 -0
  32. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/summary.py +0 -0
  33. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig/private/update_all.py +0 -0
  34. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig.egg-info/SOURCES.txt +0 -0
  35. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig.egg-info/dependency_links.txt +0 -0
  36. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig.egg-info/requires.txt +0 -0
  37. {casaconfig-1.2.0 → casaconfig-1.3.1}/casaconfig.egg-info/top_level.txt +0 -0
  38. {casaconfig-1.2.0 → casaconfig-1.3.1}/setup.cfg +0 -0
  39. {casaconfig-1.2.0 → casaconfig-1.3.1}/tests/test_casaconfig.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: casaconfig
3
- Version: 1.2.0
3
+ Version: 1.3.1
4
4
  Summary: CASA Operational Configuration Package
5
5
  Author-email: National Radio Astronomy Observatory <casa-feedback@nrao.edu>
6
6
  License: Apache License
@@ -0,0 +1,91 @@
1
+ # Copyright 2023 AUI, Inc. Washington DC, USA
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ """
15
+ this module will be included in the api
16
+ """
17
+
18
+ def measures_available():
19
+ """
20
+ List available measures versions on ASTRON at https://www.astron.nl/iers/
21
+
22
+ This returns a list of the measures versions available on the ASTRON
23
+ server. The version parameter of measures_update must be one
24
+ of the values in that list if set (otherwise the most recent version
25
+ in this list is used).
26
+
27
+ Parameters
28
+ None
29
+
30
+ Returns
31
+ list - version names returned as list of strings
32
+
33
+ Raises
34
+ - casaconfig.NoNetwork - Raised where there is no network seen, can not continue
35
+ - casaconfig.RemoteError - Raised when there is an error fetching some remote content for some reason other than no network
36
+ - Exception - Unexpected exception while getting list of available measures versions
37
+
38
+ """
39
+
40
+ import html.parser
41
+ import urllib.request
42
+ import urllib.error
43
+ import ssl
44
+ import certifi
45
+
46
+ from casaconfig import RemoteError
47
+ from casaconfig import NoNetwork
48
+
49
+ from .have_network import have_network
50
+
51
+ if not have_network():
52
+ raise NoNetwork("No network, can not find the list of available data.")
53
+
54
+ class LinkParser(html.parser.HTMLParser):
55
+ def reset(self):
56
+ super().reset()
57
+ self.rundataList = []
58
+
59
+ def handle_starttag(self, tag, attrs):
60
+ if tag == 'a':
61
+ for (name, value) in attrs:
62
+ # only care if this is an href and the value starts with
63
+ # WSRT_Measures and has 'tar' after character 15 to exclude the "WSRT_Measures.ztar" file
64
+ # without relying on the specific type of compression or nameing in more detail than that
65
+ if name == 'href' and (value.startswith('WSRT_Measures') and (value.rfind('tar')>15)):
66
+ # only add it to the list if it's not already there
67
+ if (value not in self.rundataList):
68
+ self.rundataList.append(value)
69
+
70
+ try:
71
+ context = ssl.create_default_context(cafile=certifi.where())
72
+ with urllib.request.urlopen('https://www.astron.nl/iers', context=context, timeout=400) as urlstream:
73
+ parser = LinkParser()
74
+ encoding = urlstream.headers.get_content_charset() or 'UTF-8'
75
+ for line in urlstream:
76
+ parser.feed(line.decode(encoding))
77
+
78
+ # return the sorted list, earliest versions are first, newest is last
79
+ return sorted(parser.rundataList)
80
+
81
+ except urllib.error.URLError as urlerr:
82
+ raise RemoteError("Unable to retrieve list of available measures versions : " + str(urlerr)) from None
83
+
84
+ except Exception as exc:
85
+ msg = "Unexpected exception while getting list of available measures versions : " + str(exc)
86
+ raise Exception(msg)
87
+
88
+ # nothing to return if it got here, must have been an exception
89
+ return []
90
+
91
+
@@ -17,20 +17,23 @@ this module will be included in the api
17
17
 
18
18
  def measures_update(path=None, version=None, force=False, logger=None, auto_update_rules=False, use_astron_obs_table=False, verbose=None):
19
19
  """
20
- Update or install the IERS data used for measures calculations from the ASTRON server at path.
20
+ Update or install the IERS data used for measures calculations from ASTRON into path.
21
21
 
22
22
  Original data source used by ASTRON is here: https://www.iers.org/IERS/EN/DataProducts/data.html
23
23
 
24
24
  If no update is necessary then this function will silently return.
25
25
 
26
- The verbose argument controls the level of information provided when this function when the data
27
- are unchanged for expected reasons. A level of 0 prints and logs nothing. A
28
- value of 1 logs the information and a value of 2 logs and prints the information.
26
+ The verbose argument controls the level of information provided by this function when the data
27
+ are unchanged for expected reasons. A level of 0 outputs nothing. A
28
+ value of 1 sends any output to the logger and a value of 2 logs and prints the information.
29
+ The default value of the verbose argument is taken from the casaconfig_verbose config
30
+ value (defaults to 1).
29
31
 
30
32
  CASA maintains a separate Observatories table which is available in the casarundata
31
33
  collection through pull_data and data_update. The Observatories table found at ASTRON
32
34
  is not installed by measures_update and any Observatories file at path will not be changed
33
- by using this function.
35
+ by using this function. This behavior can be changed by setting force and use_astron_obs_table
36
+ both to True (use_astron_obs_table is ignored when force is False).
34
37
 
35
38
  A text file (readme.txt in the geodetic directory in path) records the measures version string
36
39
  and the date when that version was installed in path.
@@ -43,9 +46,9 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
43
46
  If a specific version is not requested (the default) and the modification time of that text
44
47
  file is less than 24 hrs before now then this function does nothing unless force is True. When this
45
48
  function checks for a more recent version and finds that the installed version is the most recent
46
- then modification time of that text file is checked to the current time even though nothing has
47
- changed in path. This limits the number of attempts to update the measures data (including checking f\
48
- or more recent data) to once per day. When the force argument is True and a specific version is
49
+ then the modification time of that text file is changed to the current time even though nothing has
50
+ changed in path. This limits the number of attempts to update the measures data (including checking
51
+ for more recent data) to once per day. When the force argument is True and a specific version is
49
52
  not requested then this function always checks for the latest version.
50
53
 
51
54
  When auto_update_rules is True then path must exist and contain the expected readme.txt file.
@@ -75,11 +78,11 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
75
78
  especially if they may also be starting at that time. If a specific version is
76
79
  requested or force is True there is a risk that the measures may be updated while
77
80
  one of those other sessions are trying to load the same measures data, leading to
78
- unpredictable results. The lock file will prevent simulateous updates from
79
- happening but if each simultanous update eventually updates the same measures
81
+ unpredictable results. The lock file will prevent simultaneous updates from
82
+ happening but if each simultaneous update eventually updates the same measures
80
83
  location (because force is True or the updates are requesting different versions)
81
- then the measures that any of those simultanous casatools modules sees is
82
- unpredictable. Avoid multiple, simultanous updates outside of the automatic
84
+ then the measures that any of those simultaneous casatools modules sees is
85
+ unpredictable. Avoid multiple, simultaneous updates outside of the automatic
83
86
  update process.
84
87
 
85
88
  **Note:** during auto updates, measures_update requires that the expected
@@ -91,10 +94,10 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
91
94
  read and write permissions there). The version must then also be None and the force option
92
95
  must be False.
93
96
 
94
- **Note::** During use outside of auto updates, if path does not exist it will be created
97
+ **Note:** During use outside of auto updates, if path does not exist it will be created
95
98
  by this function.
96
99
 
97
- **Notes::** During use outside of auto updates, if the readme.txt file exists but can not
100
+ **Note:** During use outside of auto updates, if the readme.txt file exists but can not
98
101
  be read as expected **OR** that file does not exist but the contents of path appear to
99
102
  contain measures data (table names in the expected locations) then this function will
100
103
  print messages describing that and exit without changing anything at path. Using
@@ -104,25 +107,26 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
104
107
 
105
108
  Parameters
106
109
  - path (str=None) - Folder path to place updated measures data. Must contain a valid geodetic/readme.txt. If not set then config.measurespath is used.
107
- - version (str=None) - Version of measures data to retrieve (usually in the form of yyyymmdd-160001.ztar, see measures_available()). Default None retrieves the latest.
110
+ - version (str=None) - Version of measures data to retrieve (usually in the form of WSRT_Measures_yyyymmdd-160001.ztar, see measures_available()). Default None retrieves the latest.
108
111
  - force (bool=False) - If True, always re-download the measures data. Default False will not download measures data if updated within the past day unless the version parameter is specified and different from what was last downloaded.
109
112
  - logger (casatools.logsink=None) - Instance of the casalogger to use for writing messages. Default None writes messages to the terminal
110
113
  - auto_update_rules (bool=False) - If True then the user must be the owner of path, version must be None, and force must be False.
114
+ - use_astron_obs_table (bool=False) - If True and force is also True then keep the Observatories table found in the Measures tar tarball (possibly overwriting the Observatories table from casarundata).
111
115
  - verbose (int=None) - Level of output, 0 is none, 1 is to logger, 2 is to logger and terminal, defaults to casaconfig_verbose in config dictionary.
112
116
 
113
117
  Returns
114
118
  None
115
119
 
116
120
  Raises
117
- casaconfig.AutoUpdatesNotAllowed - raised when path does not exists as a directory or is not owned by the user when auto_update_rules is True
118
- casaconfig.BadLock - raised when the lock file was not empty when found
119
- casaconfig.BadReadme - raised when something unexpected is found in the readme or the readme changed after an update is in progress
120
- casaconfig.NoReadme - raised when the readme.txt file is not found at path (path also may not exist)
121
- casaconfig.NotWritable - raised when the user does not have permission to write to path
122
- casaconfig.NoNetwork - raised by measuers_available or when getting the lock file if there is no network.
123
- casaconfig.RemoteError - raised by measures_available when the remote list of measures could not be fetched, not due to no network.
124
- casaconfig.UnsetMeasurespath - raised when path is None and has not been set in config
125
- Exception - raised when something unexpected happened while updating measures
121
+ - casaconfig.AutoUpdatesNotAllowed - raised when path does not exists as a directory or is not owned by the user when auto_update_rules is True
122
+ - casaconfig.BadLock - raised when the lock file was not empty when found
123
+ - casaconfig.BadReadme - raised when something unexpected is found in the readme or the readme changed after an update is in progress
124
+ - casaconfig.NoReadme - raised when the readme.txt file is not found at path (path also may not exist)
125
+ - casaconfig.NotWritable - raised when the user does not have permission to write to path
126
+ - casaconfig.NoNetwork - raised by measuers_available or when getting the lock file if there is no network.
127
+ - casaconfig.RemoteError - raised by measures_available when the remote list of measures could not be fetched, not due to no network.
128
+ - casaconfig.UnsetMeasurespath - raised when path is None and has not been set in config
129
+ - Exception - raised when something unexpected happened while updating measures
126
130
 
127
131
  """
128
132
  import os
@@ -130,13 +134,12 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
130
134
  from datetime import datetime
131
135
  import sys
132
136
 
133
- from ftplib import FTP
134
137
  import tarfile
135
138
  import re
136
139
  import ssl
137
140
  import urllib.request
138
141
  import certifi
139
- import fcntl
142
+ import shutil
140
143
 
141
144
  from casaconfig import measures_available
142
145
  from casaconfig import AutoUpdatesNotAllowed, UnsetMeasurespath, RemoteError, NotWritable, BadReadme, BadLock, NoReadme, NoNetwork
@@ -248,7 +251,7 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
248
251
 
249
252
  # lock the measures_update.lock file
250
253
  lock_fd = None
251
- clean_lock = True # set to false if the contents are actively being u pdate and the lock file should not be cleaned one exception
254
+ clean_lock = True # set to false if the contents are actively being update and the lock file should not be cleaned one exception
252
255
  try:
253
256
  print_log_messages('measures_update ... acquiring the lock ... ', logger)
254
257
 
@@ -290,13 +293,9 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
290
293
  if force:
291
294
  print_log_messages('A measures update has been requested by the force argument', logger)
292
295
 
293
- print_log_messages(' ... connecting to ftp.astron.nl ...', logger)
296
+ print_log_messages(' ... finding available measures at www.astron.nl ...', logger)
294
297
 
295
- clean_lock = False
296
- ftp = FTP('ftp.astron.nl')
297
- rc = ftp.login()
298
- rc = ftp.cwd('outgoing/Measures')
299
- files = sorted([ff for ff in ftp.nlst() if (len(ff) > 0) and (not ff.endswith('.dat')) and (ftp.size(ff) > 0)])
298
+ files = measures_available()
300
299
 
301
300
  # target filename to download
302
301
  # for the non-force unspecified version case this can only get here if the age is > 1 day so there should be a newer version
@@ -306,51 +305,51 @@ def measures_update(path=None, version=None, force=False, logger=None, auto_upda
306
305
  print_log_messages("measures_update can't find specified version %s" % target, logger, True)
307
306
 
308
307
  else:
309
- # there are files to extract, make sure there's no past measures.ztar from a failed previous install
310
- ztarPath = os.path.join(path,'measures.ztar')
311
- if os.path.exists(ztarPath):
312
- os.remove(ztarPath)
313
-
314
- with open(ztarPath, 'wb') as fid:
315
- print_log_messages(' ... downloading %s from ASTRON server to %s ...' % (target, path), logger)
316
- ftp.retrbinary('RETR ' + target, fid.write)
317
-
318
- ftp.close()
319
-
308
+ # there are files to extract
309
+ print_log_messages(' ... downloading %s from ASTRON server to %s ...' % (target, path), logger)
310
+
311
+ astronURL = 'https://www.astron.nl/iers'
312
+ context = ssl.create_default_context(cafile=certifi.where())
313
+ # just in case there's a redirect at astron the way there is for the go.nrao.edu site and casarundata
314
+ measuresURLroot = urllib.request.urlopen(astronURL, context=context).url
315
+ measuresURL = os.path.join(measuresURLroot, target)
316
+
317
+ # it's at this point that this code starts modifying what's there so the lock file should
318
+ # not be removed on failure after this although it may leave that temp tar file around, but that's OK
319
+ clean_lock = False
320
320
  # remove any existing measures readme.txt now in case something goes wrong during extraction
321
321
  readme_path = os.path.join(path,'geodetic/readme.txt')
322
322
  if os.path.exists(readme_path):
323
323
  os.remove(readme_path)
324
324
 
325
- # extract from the fetched tarfile
326
- with tarfile.open(ztarPath, mode='r:gz') as ztar:
327
- # the list of members to extract
328
- x_list = []
329
- for m in ztar.getmembers() :
330
- if force and use_astron_obs_table:
331
- # exclude the *.old names in geodetic
332
- if not(re.search('geodetic',m.name) and re.search('.old',m.name)):
333
- x_list.append(m)
334
- else:
335
- # exclude the Observatories table and *.old names in geodetic
336
- if not((re.search('geodetic',m.name) and re.search('.old',m.name)) or re.search('Observatories',m.name)):
337
- x_list.append(m)
338
-
325
+ # custom filter that incorporates data_filter to watch for dangerous members of the tar file and
326
+ # add filtering to remove the Observatories table (unless use_astron_obs_table is True) and
327
+ # the *.old tables that may be in the geodetic tree
328
+ def custom_filter(member, extractionPath):
329
+ # member is a TarInfo instance and extractionPath is the destination path
330
+ # use the 'data_filter' first to deal with dangerous members
331
+ member = tarfile.data_filter(member, extractionPath)
332
+ # always exclude *.old names in geodetic
333
+ if (member is not None) and (re.search('geodetic',member.name) and re.search('.old',member.name)):
334
+ member = None
335
+ # the use_astron_obs_table argumen only has weight if force is True
336
+ if (not (force and use_astron_obs_table)) and (member is not None) and (re.search('Observatories',member.name)):
337
+ member = None
338
+ return member
339
+
340
+ with urllib.request.urlopen(measuresURL, context=context, timeout=400) as tstream, tarfile.open(fileobj=tstream, mode='r|*') as tar :
339
341
  # use the 'data' filter if available, revert to previous 'fully_trusted' behavior of not available
340
- ztar.extraction_filter = getattr(tarfile, 'data_filter', (lambda member, path: member))
341
- ztar.extractall(path=path,members=x_list)
342
- ztar.close()
343
-
344
- os.remove(ztarPath)
342
+ tar.extraction_filter = custom_filter
343
+ tar.extractall(path=path)
344
+ tar.close()
345
345
 
346
346
  # create a new readme.txt file
347
347
  with open(readme_path,'w') as fid:
348
348
  fid.write("# measures data populated by casaconfig\nversion : %s\ndate : %s" % (target, datetime.today().strftime('%Y-%m-%d')))
349
349
 
350
+ clean_lock = True
350
351
  print_log_messages(' ... measures data updated at %s' % path, logger)
351
352
 
352
- clean_lock = True
353
-
354
353
  # closing out the do_update
355
354
 
356
355
  # closing out the try block
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: casaconfig
3
- Version: 1.2.0
3
+ Version: 1.3.1
4
4
  Summary: CASA Operational Configuration Package
5
5
  Author-email: National Radio Astronomy Observatory <casa-feedback@nrao.edu>
6
6
  License: Apache License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "casaconfig"
3
- version = "1.2.0"
3
+ version = "1.3.1"
4
4
  description = "CASA Operational Configuration Package"
5
5
  readme = 'README.md'
6
6
  authors = [
@@ -1,66 +0,0 @@
1
- # Copyright 2020 AUI, Inc. Washington DC, USA
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
- """
15
- this module will be included in the api
16
- """
17
-
18
-
19
- def measures_available():
20
- """
21
- List available measures versions on the ASTRON server
22
-
23
- This returns a list of the measures files available on the ASTRON
24
- server. The version parameter of measures_update must be one
25
- of the values in that list if set (otherwise the most recent version
26
- in this list is used).
27
-
28
- Parameters
29
- None
30
-
31
- Returns
32
- version names returned as list of strings
33
-
34
- Raises:
35
- - casaconfig.NoNetwork - raised when there is no network (have_data returns False)
36
- - casaconfig.RemoteError - raised when when a socket.gaierror is seen, unlikely due to the have_network check
37
- - Exception: raised when any unexpected exception happens
38
-
39
- """
40
- from ftplib import FTP
41
- import socket
42
-
43
- from casaconfig import RemoteError
44
- from casaconfig import NoNetwork
45
-
46
- from .have_network import have_network
47
-
48
- if not have_network():
49
- raise NoNetwork("can not find the list of available measures data")
50
-
51
- files = []
52
- try:
53
- ftp = FTP('ftp.astron.nl')
54
- rc = ftp.login()
55
- rc = ftp.cwd('outgoing/Measures')
56
- files = ftp.nlst()
57
- ftp.quit()
58
- #files = [ff.replace('WSRT_Measures','').replace('.ztar','').replace('_','') for ff in files]
59
- files = [ff for ff in files if (len(ff) > 0) and (not ff.endswith('.dat'))]
60
- except socket.gaierror as gaierr:
61
- raise RemoteError("Unable to retrieve list of available measures versions : " + str(gaierr)) from None
62
- except Exception as exc:
63
- msg = "Unexpected exception while getting list of available measures versions : " + str(exc)
64
- raise Exception(msg)
65
-
66
- return files
File without changes
File without changes
File without changes
File without changes