Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatasks/rmtables.py: 89%

27 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-01 07:19 +0000

1##################### generated by xml-casa (v2) from rmtables.xml ################## 

2##################### 9c9e8a04e66b72709cb57b410e3e40a4 ############################## 

3from __future__ import absolute_import 

4import numpy 

5from casatools.typecheck import CasaValidator as _val_ctor 

6_pc = _val_ctor( ) 

7from casatools.coercetype import coerce as _coerce 

8from casatools.errors import create_error_string 

9from .private.task_rmtables import rmtables as _rmtables_t 

10from casatasks.private.task_logging import start_log as _start_log 

11from casatasks.private.task_logging import end_log as _end_log 

12from casatasks.private.task_logging import except_log as _except_log 

13 

14class _rmtables: 

15 """ 

16 rmtables ---- Remove tables cleanly, use this instead of rm -rf 

17 

18  

19 This task removes tables if they are not being currently accessed via 

20 the casapy process. Note: if you have multiple sessions running bad things 

21 could happen if you remove a table being accessed by another process. 

22  

23 

24 --------- parameter descriptions --------------------------------------------- 

25 

26 tablenames Name of the tables 

27 

28 --------- examples ----------------------------------------------------------- 

29 

30  

31 Removes tables cleanly. 

32 Arguments may contain * or ?. Ranges [] are support but 

33 not ~ expansion. 

34  

35 

36 

37 """ 

38 

39 _info_group_ = """manipulation""" 

40 _info_desc_ = """Remove tables cleanly, use this instead of rm -rf""" 

41 

42 def __call__( self, tablenames=[ ] ): 

43 schema = {'tablenames': {'type': 'cStrVec', 'coerce': [_coerce.to_list,_coerce.to_strvec]}} 

44 doc = {'tablenames': tablenames} 

45 assert _pc.validate(doc,schema), create_error_string(_pc.errors) 

46 _logging_state_ = _start_log( 'rmtables', [ 'tablenames=' + repr(_pc.document['tablenames']) ] ) 

47 task_result = None 

48 try: 

49 task_result = _rmtables_t( _pc.document['tablenames'] ) 

50 except Exception as exc: 

51 _except_log('rmtables', exc) 

52 raise 

53 finally: 

54 task_result = _end_log( _logging_state_, 'rmtables', task_result ) 

55 return task_result 

56 

57rmtables = _rmtables( ) 

58