MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / split_command

Method split_command

mod/project/python/serviceMod.py:239–262  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

237 return None
238
239 def split_command(self) -> List[str]:
240 res = []
241 tmp = ""
242 in_quot = False
243 for i in self.command:
244 if i in (' ', '\t', '\r'):
245 if tmp and not in_quot:
246 res.append(tmp)
247 tmp = ""
248 if in_quot:
249 tmp += ' '
250
251 elif i in ("'", '"'):
252 if in_quot:
253 in_quot = False
254 else:
255 in_quot = True
256 else:
257 tmp += i
258
259 if tmp:
260 res.append(tmp)
261
262 return res
263
264 def stop(self) -> None:
265 pid = self.get_service_pid()

Callers 2

get_pid_by_commandMethod · 0.95
get_pid_by_commandMethod · 0.45

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected