MCPcopy
hub / github.com/scrapy/scrapy / get_help

Method get_help

scrapy/shell.py:282–304  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

280 print(self.get_help())
281
282 def get_help(self) -> str:
283 b = []
284 b.append("Available Scrapy objects:")
285 b.append(
286 " scrapy scrapy module (contains scrapy.Request, scrapy.Selector, etc)"
287 )
288 for k, v in sorted(self.vars.items()):
289 if self._is_relevant(v):
290 b.append(f" {k:<10} {v}")
291 b.append("Useful shortcuts:")
292 if self.fetch_available:
293 b.append(
294 " fetch(url[, redirect=True]) "
295 "Fetch URL and update local objects (by default, redirects are followed)"
296 )
297 b.append(
298 " fetch(req) "
299 "Fetch a scrapy.Request and update local objects "
300 )
301 b.append(" shelp() Shell help (print this help)")
302 b.append(" view(response) View response in a browser")
303
304 return "\n".join(f"[s] {line}" for line in b) + "\n"
305
306 def _is_relevant(self, value: Any) -> bool:
307 return isinstance(value, self.relevant_classes) or is_item(value)

Callers 2

populate_varsMethod · 0.95
print_helpMethod · 0.95

Calls 3

_is_relevantMethod · 0.95
itemsMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected