Trees | Indices | Help |
|
---|
|
1 # coding: utf8 2 # 3 # Project: The EDNA Kernel 4 # http://www.edna-site.org 5 # 6 # File: "$Id$" 7 # 8 # Copyright (C) 2008 European Synchrotron Radiation Facility 9 # Grenoble, France 10 # 11 # Principal authors: Marie-Francoise Incardona (incardon@esrf.fr) 12 # Olof Svensson (svensson@esrf.fr) 13 # 14 # This program is free software: you can redistribute it and/or modify 15 # it under the terms of the GNU General Public License as published by 16 # the Free Software Foundation, either version 3 of the License, or 17 # (at your option) any later version. 18 # 19 # This program is distributed in the hope that it will be useful, 20 # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 # GNU General Public License for more details. 23 # 24 # You should have received a copy of the GNU General Public License 25 # along with this program. If not, see <http://www.gnu.org/licenses/>. 26 # 27 28 __authors__ = [ "Olof Svensson", "Marie-Francoise Incardona", "Jérôme Kieffer" ] 29 __contact__ = "svensson@esrf.fr" 30 __license__ = "LGPLv3+" 31 __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" 32 __date__ = "20120213" 33 34 from EDUtilsPath import EDUtilsPath 35 from EDUtilsFile import EDUtilsFile 36 from EDFactoryPluginTest import EDFactoryPluginTest 37 from EDDecorator import deprecated41 42 __edFactoryPluginTest = None 43 44 @classmethod16546 if (cls.__edFactoryPluginTest is None): 47 cls.__edFactoryPluginTest = EDFactoryPluginTest() 48 return cls.__edFactoryPluginTest49 50 51 @staticmethod53 """ 54 Reads a file and parses potential existing environment variables such as: 55 - EDNA_TESTS_DATA_HOME 56 Returns the content of this file as a string 57 """ 58 return EDUtilsFile.readFileAndParseVariables(_strFileName, EDUtilsPath.getDictOfPaths())59 60 61 @staticmethod 62 @deprecated64 """ 65 Reads a file and parses potential existing environment variables such as: 66 Returns the content of this file as a string 67 """ 68 69 return EDUtilsFile.readFileAndParseVariables(_strFileName, {_strKey:_strValue})70 71 72 @staticmethod 73 @deprecated75 """ 76 Returns the content of this file as a string 77 """ 78 return EDUtilsFile.readFileAndParseVariables(_strFileName, _dictReplacements)79 80 81 @staticmethod 82 @deprecated84 """ 85 Reads a file 86 Returns its content as a string 87 """ 88 return EDUtilsFile.readFile(_strFileName)89 90 @staticmethod 91 @deprecated 97 98 99 100 @staticmethod 101 @deprecated103 """ 104 Returns the tests home directory path <EDNA_HOME>/tests 105 """ 106 return EDUtilsPath.EDNA_TESTS107 108 109 @staticmethod 110 @deprecated112 """ 113 Returns the tests data directory path <EDNA_HOME>/tests/data 114 """ 115 return EDUtilsPath.EDNA_TESTDATA116 117 118 @staticmethod 119 @deprecated121 """ 122 Returns the tests data image directory path <EDNA_HOME>/tests/data/images or what is relevant 123 """ 124 return EDUtilsPath.EDNA_TESTIMAGES125 126 127 @classmethod129 """ 130 Given a test case name, returns the corresponding test data directory. 131 """ 132 strModuleLocation = cls.getFactoryPluginTest().getModuleLocation(_strPluginTestName) 133 strPluginTestDataDirectory = EDUtilsPath.appendListOfPaths(strModuleLocation, [ "..", "data" ]) 134 return strPluginTestDataDirectory135 136 137 @classmethod139 """ 140 Returns the configuration directory path for a given test module 141 """ 142 strModuleLocation = cls.getFactoryPluginTest().getModuleLocation(_strPluginTestName) 143 strConfigurationHome = EDUtilsPath.appendListOfPaths(strModuleLocation, [ "..", "..", "..", "..", "conf" ]) 144 return strConfigurationHome145 146 147 @staticmethod149 """ 150 Try to get the method name ... by first converting it to a string an processing the string ... not optimal but it works 151 152 Nota: Refactored as a static method, 20100430 JKR 153 154 @param _strText: anything that could be converted to string, here it seems to be a method or a function 155 @return: the word after the 156 @rtype: string 157 """ 158 strReturn = "None Object" 159 listWords = str(_strText).replace("<", " ").split() 160 if "method" in listWords: 161 i = listWords.index("method") 162 if i < len(listWords) - 1: 163 strReturn = listWords[i + 1] 164 return strReturn
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 20 03:53:32 2014 | http://epydoc.sourceforge.net |