MCPcopy Create free account
hub / github.com/pyload/pyload / parseInput

Method parseInput

module/cli/ManageFiles.py:183–204  ·  view source on GitHub ↗
(self, inp, package=True)

Source from the content-addressed store, hash-verified

181 return data
182
183 def parseInput(self, inp, package=True):
184 inp = inp.strip()
185 if "-" in inp:
186 l, n, h = inp.partition("-")
187 l = int(l)
188 h = int(h)
189 r = range(l, h + 1)
190
191 ret = []
192 if package:
193 for p in self.cache:
194 if p.pid in r:
195 ret.append(p.pid)
196 else:
197 for l in self.links.links:
198 if l.lid in r:
199 ret.append(l.lid)
200
201 return ret
202
203 else:
204 return [int(x) for x in inp.split(",")]

Callers 1

onEnterMethod · 0.95

Calls 2

splitMethod · 0.80
appendMethod · 0.45

Tested by

no test coverage detected