Return a dictionary with items that are compatible with numpy.distutils.setup keyword arguments.
(self, notfound_action=0)
| 842 | return info |
| 843 | |
| 844 | def get_info(self, notfound_action=0): |
| 845 | """ Return a dictionary with items that are compatible |
| 846 | with numpy.distutils.setup keyword arguments. |
| 847 | """ |
| 848 | flag = 0 |
| 849 | if not self.has_info(): |
| 850 | flag = 1 |
| 851 | log.info(self.__class__.__name__ + ':') |
| 852 | if hasattr(self, 'calc_info'): |
| 853 | self.calc_info() |
| 854 | if notfound_action: |
| 855 | if not self.has_info(): |
| 856 | if notfound_action == 1: |
| 857 | warnings.warn(self.notfounderror.__doc__, stacklevel=2) |
| 858 | elif notfound_action == 2: |
| 859 | raise self.notfounderror(self.notfounderror.__doc__) |
| 860 | else: |
| 861 | raise ValueError(repr(notfound_action)) |
| 862 | |
| 863 | if not self.has_info(): |
| 864 | log.info(' NOT AVAILABLE') |
| 865 | self.set_info() |
| 866 | else: |
| 867 | log.info(' FOUND:') |
| 868 | |
| 869 | res = self.saved_results.get(self.__class__.__name__) |
| 870 | if log.get_threshold() <= log.INFO and flag: |
| 871 | for k, v in res.items(): |
| 872 | v = str(v) |
| 873 | if k in ['sources', 'libraries'] and len(v) > 270: |
| 874 | v = v[:120] + '...\n...\n...' + v[-120:] |
| 875 | log.info(' %s = %s', k, v) |
| 876 | log.info('') |
| 877 | |
| 878 | return copy.deepcopy(res) |
| 879 | |
| 880 | def get_paths(self, section, key): |
| 881 | dirs = self.cp.get(section, key).split(os.pathsep) |