MCPcopy Create free account
hub / github.com/apache/cloudstack / xsplit

Function xsplit

tools/marvin/marvin/lib/utils.py:267–277  ·  view source on GitHub ↗

Split a string in `txt` by list of delimiters in `seps` @param txt: string to split @param seps: list of separators @return: list of split units

(txt, seps)

Source from the content-addressed store, hash-verified

265
266
267def xsplit(txt, seps):
268 """
269 Split a string in `txt` by list of delimiters in `seps`
270 @param txt: string to split
271 @param seps: list of separators
272 @return: list of split units
273 """
274 default_sep = seps[0]
275 for sep in seps[1:]: # we skip seps[0] because that's the default separator
276 txt = txt.replace(sep, default_sep)
277 return [i.strip() for i in txt.split(default_sep)]
278
279def get_hypervisor_type(apiclient):
280

Callers 4

get_free_vlanFunction · 0.90
setNonContiguousVlanIdsFunction · 0.90

Calls 1

replaceMethod · 0.80