For a file that contains a single OVAL XML element as the root element, instantiate the appropriate OvalElement sublcass for that element @type path: string @param path: the path to the file @rtype OvalElement @return None on error, or an object of the appropriate Ov
(path)
| 954 | |
| 955 | @staticmethod |
| 956 | def fromStandaloneFile(path): |
| 957 | """For a file that contains a single OVAL XML element as the root element, instantiate the appropriate OvalElement sublcass for that element |
| 958 | @type path: string |
| 959 | @param path: the path to the file |
| 960 | |
| 961 | @rtype OvalElement |
| 962 | @return None on error, or an object of the appropriate OvalElement subclass |
| 963 | """ |
| 964 | |
| 965 | if not path or path is None: |
| 966 | return None |
| 967 | |
| 968 | if not os.path.exists(path): |
| 969 | return None |
| 970 | |
| 971 | try: |
| 972 | tree = ElementTree.ElementTree() |
| 973 | tree.parse(path) |
| 974 | root = tree.getroot() |
| 975 | return OvalElement.asOvalElement(root) |
| 976 | |
| 977 | except Exception: |
| 978 | return None |
| 979 | |
| 980 | @staticmethod |
| 981 | def getElementTypeFromOvalID(ovalid): |
nothing calls this directly
no test coverage detected