19 from ..
import context, robotapi, utils
20 from ..utils.versioncomparator
import cmp_versions
21 from .iteminfo
import _XMLKeywordContent
28 self.
_directories_directories.append(context.LIBRARY_XML_DIRECTORY)
43 current_xml_file =
None
46 if name_from_xml == name:
48 xml_file, current_xml_file)
49 return current_xml_file
53 version2 = self.
_get_version_get_version(current_xml_file)
56 return current_xml_file
60 return utils.ET.parse(xml_file).getroot().find(
'version').text
65 for filename
in os.listdir(directory):
66 path = os.path.join(directory, filename)
67 if path.endswith(
'.xml')
and os.path.isfile(path):
71 return utils.find_from_pythonpath(name +
'.xml')
84 root = utils.ET.parse(file).getroot()
85 if root.tag !=
'keywordspec':
88 kw_nodes = root.findall(
'keywords/kw') + root.findall(
'kw')
89 source_type = root.get(
'type')
90 doc_format = root.get(
'format')
91 if source_type ==
'resource':
92 source_type +=
' file'
98 return name.replace(
' ',
'')
103 return path.lower().endswith((
'.py',
'.java',
'.class',
'/', os.sep))
107 for base
in [basedir] + sys.path:
108 if not (base
and os.path.isdir(base)):
110 ret = os.path.join(base, path)
111 if os.path.isfile(ret):
113 if os.path.isdir(ret)
and \
114 os.path.isfile(os.path.join(ret,
'__init__.py')):
120 if os.path.exists(name):
122 return name.replace(
' ',
'')
127 root = utils.ET.parse(path).getroot()
128 name = root.get(
'name')
Used when variable does not exist.
def _init_from_specfile(self, specfile, name)
def _find_from_library_xml_directories(self, name)
def _find_from_library_xml_directory(self, directory, name)
def _find_from_pythonpath(self, name)
def init_from_spec(self, name)
def _get_version(self, xml_file)
def _get_newest_xml_file(self, xml_file, current_xml_file)
def __init__(self, directories=None)
def _list_xml_files_in(self, directory)
def get_name_from_xml(path)
def _parse_xml(file, name)
def _resolve_path(path, basedir)
def _get_library_name(name)
def _is_library_by_path(path)
def get_path(name, basedir)
def cmp_versions(version1, version2)