diff --git a/docs/topics/telnetconsole.rst b/docs/topics/telnetconsole.rst index ad2fa75b2..8b9efa5a7 100644 --- a/docs/topics/telnetconsole.rst +++ b/docs/topics/telnetconsole.rst @@ -37,17 +37,32 @@ Available aliases in the telnet console The telnet console is like a regular Python shell running inside the Scrapy process, so you can do anything from it including imports, etc. -However, the telnet console comes with some default aliases defined for +However, the telnet console comes with some default shortcuts defined for convenience: - * ``engine``: the Scrapy engine object (``scrapy.core.engine.scrapyengine``) - * ``manager``: the Scrapy manager object (``scrapy.core.manager.scrapymanager``) - * ``extensions``: the extensions object (``scrapy.extension.extensions``) - * ``stats``: the Scrapy stats object (``scrapy.stats.stats``) - * ``settings``: the Scrapy settings object (``scrapy.conf.settings``) - * ``p``: the pprint function (``pprint.pprint``) - * ``prefs``: for memory debugging (see :ref:`topics-leaks`) - * ``hpy``: for memory debugging (see :ref:`topics-leaks`) ++----------------+-------------------------------------------------------------------+ +| Shortcut | Description | ++================+===================================================================+ +| ``engine`` | the Scrapy engine object (``scrapy.core.engine.scrapyengine``) | ++----------------+-------------------------------------------------------------------+ +| ``manager`` | the Scrapy manager object (``scrapy.core.manager.scrapymanager``) | ++----------------+-------------------------------------------------------------------+ +| ``extensions`` | the extensions object (``scrapy.extension.extensions``) | ++----------------+-------------------------------------------------------------------+ +| ``stats`` | the Scrapy stats object (``scrapy.stats.stats``) | ++----------------+-------------------------------------------------------------------+ +| ``settings`` | the Scrapy settings object (``scrapy.conf.settings``) | ++----------------+-------------------------------------------------------------------+ +| ``est`` | print a report of the current engine status | ++----------------+-------------------------------------------------------------------+ +| ``prefs`` | for memory debugging (see :ref:`topics-leaks`) | ++----------------+-------------------------------------------------------------------+ +| ``p`` | a shortcut to the `pprint.pprint`_ function | ++----------------+-------------------------------------------------------------------+ +| ``hpy`` | for memory debugging (see :ref:`topics-leaks`) | ++----------------+-------------------------------------------------------------------+ + +.. _pprint.pprint: http://docs.python.org/library/pprint.html#pprint.pprint Some example of using the telnet console ======================================== @@ -61,7 +76,7 @@ You can use the ``st()`` method of the Scrapy engine to quickly show its state using the telnet console:: telnet localhost 6023 - >>> engine.st() + >>> est() Execution engine status datetime.now()-self.start_time : 0:00:09.051588 diff --git a/scrapy/contrib/memusage.py b/scrapy/contrib/memusage.py index 196e4d2dd..cb53e44e5 100644 --- a/scrapy/contrib/memusage.py +++ b/scrapy/contrib/memusage.py @@ -19,6 +19,7 @@ from scrapy.mail import MailSender from scrapy.conf import settings from scrapy.stats import stats from scrapy.utils.memory import get_vmvalue_from_procfs +from scrapy.utils.engine import get_engine_status class MemoryUsage(object): @@ -97,6 +98,6 @@ class MemoryUsage(object): s += "ENGINE STATUS ------------------------------------------------------- \r\n" s += "\r\n" - s += scrapyengine.getstatus() + s += get_engine_status() s += "\r\n" self.mail.send(rcpts, subject, s) diff --git a/scrapy/contrib/webconsole/enginestatus.py b/scrapy/contrib/webconsole/enginestatus.py index f34d3a375..623f777ef 100644 --- a/scrapy/contrib/webconsole/enginestatus.py +++ b/scrapy/contrib/webconsole/enginestatus.py @@ -2,7 +2,7 @@ Scheduler information module for Scrapy webconsole """ from scrapy.xlib.pydispatch import dispatcher -from scrapy.core.engine import scrapyengine +from scrapy.utils.engine import get_engine_status from scrapy.management.web import banner class EngineStatus(object): @@ -16,7 +16,7 @@ class EngineStatus(object): def webconsole_render(self, wc_request): s = banner(self) s += "
\n"
- s += scrapyengine.getstatus()
+ s += get_engine_status()
s += "\n"
s += "