Coverage for /wheeldirectory/casa-6.7.0-12-py3.10.el8/lib/py/lib/python3.10/site-packages/casatools/__casac__/utils.py: 58%
168 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-01 07:19 +0000
1# This file was automatically generated by SWIG (http://www.swig.org).
2# Version 3.0.12
3#
4# Do not make changes to this file unless you know what you are doing--modify
5# the SWIG interface file instead.
7from sys import version_info as _swig_python_version_info
8if _swig_python_version_info >= (2, 7, 0):
9 def swig_import_helper():
10 import importlib
11 pkg = __name__.rpartition('.')[0]
12 mname = '.'.join((pkg, '_utils')).lstrip('.')
13 try:
14 return importlib.import_module(mname)
15 except ImportError:
16 return importlib.import_module('_utils')
17 _utils = swig_import_helper()
18 del swig_import_helper
19elif _swig_python_version_info >= (2, 6, 0):
20 def swig_import_helper():
21 from os.path import dirname
22 import imp
23 fp = None
24 try:
25 fp, pathname, description = imp.find_module('_utils', [dirname(__file__)])
26 except ImportError:
27 import _utils
28 return _utils
29 try:
30 _mod = imp.load_module('_utils', fp, pathname, description)
31 finally:
32 if fp is not None:
33 fp.close()
34 return _mod
35 _utils = swig_import_helper()
36 del swig_import_helper
37else:
38 import _utils
39del _swig_python_version_info
41try:
42 _swig_property = property
43except NameError:
44 pass # Python < 2.2 doesn't have 'property'.
46try:
47 import builtins as __builtin__
48except ImportError:
49 import __builtin__
51def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
52 if (name == "thisown"):
53 return self.this.own(value)
54 if (name == "this"):
55 if type(value).__name__ == 'SwigPyObject':
56 self.__dict__[name] = value
57 return
58 method = class_type.__swig_setmethods__.get(name, None)
59 if method:
60 return method(self, value)
61 if (not static):
62 if _newclass:
63 object.__setattr__(self, name, value)
64 else:
65 self.__dict__[name] = value
66 else:
67 raise AttributeError("You cannot add attributes to %s" % self)
70def _swig_setattr(self, class_type, name, value):
71 return _swig_setattr_nondynamic(self, class_type, name, value, 0)
74def _swig_getattr(self, class_type, name):
75 if (name == "thisown"):
76 return self.this.own()
77 method = class_type.__swig_getmethods__.get(name, None)
78 if method:
79 return method(self)
80 raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))
83def _swig_repr(self):
84 try:
85 strthis = "proxy of " + self.this.__repr__()
86 except __builtin__.Exception:
87 strthis = ""
88 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
90try:
91 _object = object
92 _newclass = 1
93except __builtin__.Exception:
94 class _object:
95 pass
96 _newclass = 0
98class utils(_object):
99 """Proxy of C++ casac::utils class."""
101 __swig_setmethods__ = {}
102 __setattr__ = lambda self, name, value: _swig_setattr(self, utils, name, value)
103 __swig_getmethods__ = {}
104 __getattr__ = lambda self, name: _swig_getattr(self, utils, name)
105 __repr__ = _swig_repr
107 def __init__(self):
108 """__init__(self) -> utils"""
109 this = _utils.new_utils()
110 try:
111 self.this.append(this)
112 except __builtin__.Exception:
113 self.this = this
115 def getrc(self, *args, **kwargs):
116 """
117 getrc(self, _rcvar) -> string
121 Input Parameters:
122 rcvar Returns the value of the rc variable given. If no value is give it returns the root directory of CASA.
124 --------------------------------------------------------------------------------
126 """
127 return _utils.utils_getrc(self, *args, **kwargs)
130 def removetable(self, *args, **kwargs):
131 """
132 removetable(self, _tablenames) -> bool
136 Input Parameters:
137 tablenames Removes tables safely
139 --------------------------------------------------------------------------------
141 """
142 return _utils.utils_removetable(self, *args, **kwargs)
145 def tableinfo(self, *args, **kwargs):
146 """
147 tableinfo(self, _tablename) -> record *
151 Summary:
152 Get information about a particular table
154 Description:
157 Currently this only returns the pid of the process locking the table (lockpid), if the lock
158 is permanent (lockperm), and the status (lockstatus) -- 'not in use', 'open', 'read', 'write',
159 or 'unknown'. However, the hope is that this will eventually return a complete description of
160 the table.
163 Input Parameters:
164 tablename path to table
166 --------------------------------------------------------------------------------
168 """
169 return _utils.utils_tableinfo(self, *args, **kwargs)
172 def lockedtables(self):
173 """
174 lockedtables(self) -> std::vector< std::string >
178 Summary:
179 get the tables locked by this process
181 --------------------------------------------------------------------------------
183 """
184 return _utils.utils_lockedtables(self)
187 def hostinfo(self):
188 """
189 hostinfo(self) -> record *
193 Summary:
194 returns host information
196 --------------------------------------------------------------------------------
198 """
199 return _utils.utils_hostinfo(self)
202 def c_exception(self):
203 """
204 c_exception(self) -> string
208 Summary:
209 Returns detailed information about last C-level exception
211 Description:
213 Returns detailed information from the last CASA C++ exception (i.e., AipsError). The
214 exception message and the stack trace (mangled; use the shell's c++filt to demangle)
215 from the last CASA C++ exception. The information is from the last one generated
216 and may not represent an exception from the last action; c_exception_clear can be
217 used to remove stale information. The information's exception might also
218 have been caught in the C++ code and not have been translated into a Python-level
219 exception.
222 --------------------------------------------------------------------------------
224 """
225 return _utils.utils_c_exception(self)
228 def c_exception_clear(self):
229 """
230 c_exception_clear(self)
234 Summary:
235 Clears information about last C-level exception
237 Description:
239 Clears the CASA C++ exception information. This allows the user to be sure that
240 information retrieved using c_exception is not from an exception in the
241 distant past.
244 --------------------------------------------------------------------------------
246 """
247 return _utils.utils_c_exception_clear(self)
250 def _trigger_segfault(self, *args, **kwargs):
251 """
252 _trigger_segfault(self, _faultType) -> bool
256 Summary:
257 Crashes casa with segfault.
259 Description:
262 This triggers a segfault for testing the crash reporter. Obviously you
263 shouldn't call this unless that's what you want. It's in here for
264 development/debugging purposes and ought to be removed before you see this.
267 Input Parameters:
268 faultType How to kill the program
270 --------------------------------------------------------------------------------
272 """
273 return _utils.utils__trigger_segfault(self, *args, **kwargs)
276 def tryit(self, *args, **kwargs):
277 """
278 tryit(self, _input) -> double
282 Description:
285 test variant convesion
287 Input Parameters:
288 input testing variant
290 --------------------------------------------------------------------------------
292 """
293 return _utils.utils_tryit(self, *args, **kwargs)
296 def maxint(self):
297 """
298 maxint(self) -> long
302 Description:
304 maximum number an C++ int can hold
306 --------------------------------------------------------------------------------
308 """
309 return _utils.utils_maxint(self)
312 def minint(self):
313 """
314 minint(self) -> long
318 Description:
320 minimum number an C++ int can hold
322 --------------------------------------------------------------------------------
324 """
325 return _utils.utils_minint(self)
328 def maxlong(self):
329 """
330 maxlong(self) -> long
334 Description:
336 maximum number an C++ long can hold
338 --------------------------------------------------------------------------------
340 """
341 return _utils.utils_maxlong(self)
344 def minlong(self):
345 """
346 minlong(self) -> long
350 Description:
352 minimum number an C++ long can hold
354 --------------------------------------------------------------------------------
356 """
357 return _utils.utils_minlong(self)
360 def initialize(self, *args, **kwargs):
361 """
362 initialize(self, _python_path, _distro_data_path, _default_path, _nogui, _agg, _pipeline, _cachedir) -> bool
366 Summary:
367 initialize CASAtools
369 Description:
372 returns true if initalization was performed; returns false if initialization was already done
374 Input Parameters:
375 python_path path to python executable
376 distro_data_path path to the data provided by the casadata pkg
377 default_path directories that should constitute the default data path
378 nogui are guis disabled at startup
379 agg was the graphical backend disabled at startup
380 pipeline was the pipeline included at startup
381 cachedir the cachedir used in configuration at startup
383 --------------------------------------------------------------------------------
385 """
386 return _utils.utils_initialize(self, *args, **kwargs)
389 def rundata(self):
390 """
391 rundata(self) -> string
395 Summary:
396 path to the measures data
398 Description:
400 path to the measures data. This function is deprecated measurespath should be used instead.
402 --------------------------------------------------------------------------------
404 """
405 return _utils.utils_rundata(self)
408 def measurespath(self):
409 """
410 measurespath(self) -> string
414 Summary:
415 path to the measures data
417 Description:
419 path to the measures data
421 --------------------------------------------------------------------------------
423 """
424 return _utils.utils_measurespath(self)
427 def setrundata(self, *args, **kwargs):
428 """
429 setrundata(self, _path)
433 Summary:
434 set path to the measures data
436 Description:
439 Set path to the measures data. Must be called during initalization
440 before Measures module is initialized. This function is deprecated.
441 setmeasurespath should be used instead.
443 Input Parameters:
444 path path to IERS data
446 --------------------------------------------------------------------------------
448 """
449 return _utils.utils_setrundata(self, *args, **kwargs)
452 def setmeasurespath(self, *args, **kwargs):
453 """
454 setmeasurespath(self, _path)
458 Summary:
459 set path to the measures data
461 Description:
464 Set path to the measures data. Must be called during initalization
465 before Measures module is initialized.
467 Input Parameters:
468 path path to IERS data
470 --------------------------------------------------------------------------------
472 """
473 return _utils.utils_setmeasurespath(self, *args, **kwargs)
476 def defaultpath(self):
477 """
478 defaultpath(self) -> std::vector< std::string >
482 Summary:
483 returns the default data path
485 Description:
488 Returns the default data path. This path is used unless the user has set the current path to something else using the setpath function.
490 --------------------------------------------------------------------------------
492 """
493 return _utils.utils_defaultpath(self)
496 def setpath(self, *args, **kwargs):
497 """
498 setpath(self, _dirs) -> bool
502 Summary:
503 sets the data path to the specified list of directories
505 Description:
508 Sets the data path to the specified list of directories. Returns true if all directories were added
509 returns false otherwise.
511 Input Parameters:
512 dirs directories that should constitute the data path
514 --------------------------------------------------------------------------------
516 """
517 return _utils.utils_setpath(self, *args, **kwargs)
520 def getpath(self):
521 """
522 getpath(self) -> std::vector< std::string >
526 Summary:
527 retrieves the data path
529 Description:
532 Returns the list of directories that are currently in the data path.
534 --------------------------------------------------------------------------------
536 """
537 return _utils.utils_getpath(self)
540 def clearpath(self):
541 """
542 clearpath(self)
546 Summary:
547 removes all directories from the data path
549 Description:
552 Removes all directories from the data path.
554 --------------------------------------------------------------------------------
556 """
557 return _utils.utils_clearpath(self)
560 def resolve(self, *args, **kwargs):
561 """
562 resolve(self, _path) -> string
566 Summary:
567 resolve a complete path from a subdirectory using the data path
569 Description:
572 If the provided path already represents a file or a directory, it is returned. If it does not,
573 this function tries to find a complete path by matching up this partial directory with the
574 elements of the data path.
576 Input Parameters:
577 path path to be expanded
579 --------------------------------------------------------------------------------
581 """
582 return _utils.utils_resolve(self, *args, **kwargs)
585 def getnogui(self):
586 """
587 getnogui(self) -> bool
591 Summary:
592 gets the nogui config value
594 Description:
597 Returns the value of the nogui parameter used at startup. Defaults to False.
600 --------------------------------------------------------------------------------
602 """
603 return _utils.utils_getnogui(self)
606 def getagg(self):
607 """
608 getagg(self) -> bool
612 Summary:
613 gets the agg config value
615 Description:
618 Returns the value of the agg parameter used at startup. Defaults to False.
621 --------------------------------------------------------------------------------
623 """
624 return _utils.utils_getagg(self)
627 def getpipeline(self):
628 """
629 getpipeline(self) -> bool
633 Summary:
634 gets the pipeline config value
636 Description:
639 Returns the value of the pipeline parameter used at startup. Defaults to False.
642 --------------------------------------------------------------------------------
644 """
645 return _utils.utils_getpipeline(self)
648 def getcachedir(self):
649 """
650 getcachedir(self) -> string
654 Summary:
655 gets the cachedir config value
657 Description:
660 Returns the value of the cachedir parameter used at startup.
663 --------------------------------------------------------------------------------
665 """
666 return _utils.utils_getcachedir(self)
669 def registry(self):
670 """
671 registry(self) -> record *
675 Summary:
676 retrieve registry information
678 Description:
681 returns record containing the URI for the CASAtools registry which can be used by other unix processes to access the registry
683 --------------------------------------------------------------------------------
685 """
686 return _utils.utils_registry(self)
689 def services(self):
690 """
691 services(self) -> record *
695 Summary:
696 retrieve registered services
698 Description:
701 returns record containing the information about the services that have been registered with CASAtools
703 --------------------------------------------------------------------------------
705 """
706 return _utils.utils_services(self)
709 def remove_service(self, *args, **kwargs):
710 """
711 remove_service(self, _uri) -> bool
715 Summary:
716 remove a service using its URI
718 Description:
721 Remove a service from the registry using the URI for the
722 service. The URI should be a string that looks something
723 like '0.0.0.0:34101'. This function returns true if the
724 removal was successful. Otherwise, it returns false.
726 Input Parameters:
727 uri uri (Address) of the service to remove.
729 --------------------------------------------------------------------------------
731 """
732 return _utils.utils_remove_service(self, *args, **kwargs)
735 def shutdown(self):
736 """
737 shutdown(self)
741 Summary:
742 shutdown signal from python
744 Description:
747 python is shutting down cleanup anything that is outstanding
749 --------------------------------------------------------------------------------
751 """
752 return _utils.utils_shutdown(self)
755 def getpython(self):
756 """
757 getpython(self) -> string
761 Summary:
762 get path to python executable
764 --------------------------------------------------------------------------------
766 """
767 return _utils.utils_getpython(self)
770 def version(self):
771 """
772 version(self) -> std::vector< long >
776 Summary:
777 returns four element vector for the version
779 Description:
783 Returns a four element vector representing the version (major, minor, patch and feature).
785 --------------------------------------------------------------------------------
787 """
788 return _utils.utils_version(self)
791 def version_variant(self):
792 """
793 version_variant(self) -> string
797 Summary:
798 returns the target instrument f.e. ALMA or VLA
800 Description:
804 Returns the target instrument. This helps distinguish versions that otherwise may have the same version number
806 --------------------------------------------------------------------------------
808 """
809 return _utils.utils_version_variant(self)
812 def version_desc(self):
813 """
814 version_desc(self) -> string
818 Summary:
819 returns the descriptive version string, e.g. DEV or REL
821 Description:
825 The descriptive string describes a particular packaged version. During a development
826 cycle there are different sorts of packaged distributions. For example, a development
827 version ('DEV') or a release version ('REL').
829 --------------------------------------------------------------------------------
831 """
832 return _utils.utils_version_desc(self)
835 def version_info(self):
836 """
837 version_info(self) -> string
841 Summary:
842 Returns the complete version description as a string.
844 Description:
848 Returns a description string that includes the version information and the descriptive string..
850 --------------------------------------------------------------------------------
852 """
853 return _utils.utils_version_info(self)
856 def version_string(self):
857 """
858 version_string(self) -> string
862 Summary:
863 Returns the complete version description as a string but without the description (i.e. git hash) string.
865 Description:
869 Returns a description string that includes the version information and the descriptive string..
871 --------------------------------------------------------------------------------
873 """
874 return _utils.utils_version_string(self)
877 def compare_version(self, *args, **kwargs):
878 """
879 compare_version(self, _comparitor, _vec) -> bool
883 Summary:
884 Returns the complete version description as a string.
886 Description:
890 Returns a description string that includes the version information and the descriptive string..
892 Input Parameters:
893 comparitor what sort of comparison to do, one of >, <, <=, >=, ==, = !=
894 vec vector to use to compare current version number against vec
896 --------------------------------------------------------------------------------
898 """
899 return _utils.utils_compare_version(self, *args, **kwargs)
901 __swig_destroy__ = _utils.delete_utils
902 __del__ = lambda self: None
903utils_swigregister = _utils.utils_swigregister
904utils_swigregister(utils)
906# This file is compatible with both classic and new-style classes.