From 7249d01709b37dceacba0b7f8138ab798e3de84a Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Fri, 28 Jun 2019 20:50:04 +0200 Subject: [PATCH] Further clarify things in the documentation --- readthedocs/concepts/sessions.rst | 8 ++++++-- readthedocs/developing/project-structure.rst | 4 ++++ readthedocs/quick-references/faq.rst | 21 ++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/readthedocs/concepts/sessions.rst b/readthedocs/concepts/sessions.rst index ee528b48..d46996bb 100644 --- a/readthedocs/concepts/sessions.rst +++ b/readthedocs/concepts/sessions.rst @@ -48,8 +48,12 @@ by setting ``client.session.save_entities = False``. Different Session Storage ========================= -If you don't want to use the default SQLite session storage, you can also use -one of the other implementations or implement your own storage. +If you don't want to use the default SQLite session storage, you can also +use one of the other implementations or implement your own storage. + +While it's often not the case, it's possible that SQLite is slow enough to +be noticeable, in which case you can also use a different storage. Note that +this is rare and most people won't have this issue, but it's worth a mention. To use a custom session storage, simply pass the custom session instance to :ref:`TelegramClient ` instead of diff --git a/readthedocs/developing/project-structure.rst b/readthedocs/developing/project-structure.rst index 960234ac..a3544a91 100644 --- a/readthedocs/developing/project-structure.rst +++ b/readthedocs/developing/project-structure.rst @@ -45,3 +45,7 @@ an index so that they can be imported easily. Custom documentation can also be generated to easily navigate through the vast amount of items offered by the API. + +If you clone the repository, you will have to run ``python setup.py gen`` +in order to generate the code. Installing the library runs the generator +too, but the mentioned command will just generate code. diff --git a/readthedocs/quick-references/faq.rst b/readthedocs/quick-references/faq.rst index f452b9ea..37221127 100644 --- a/readthedocs/quick-references/faq.rst +++ b/readthedocs/quick-references/faq.rst @@ -215,6 +215,27 @@ alternative to `Flask `_. Check out `quart_login.py`_ for an example web-application based on Quart. +Can I use Anaconda/Spyder/IPython with the library? +=================================================== + +Yes, but these interpreters run the asyncio event loop implicitly, +which interferes with the ``telethon.sync`` magic module. + +If you use them, you should **not** import ``sync``: + +.. code-block:: python + + # Change any of these...: + from telethon import TelegramClient, sync, ... + from telethon.sync import TelegramClient, ... + + # ...with this: + from telethon import TelegramClient, ... + +You are also more likely to get "sqlite3.OperationalError: database is locked" +with them. If they cause too much trouble, just write your code in a ``.py`` +file and run that, or use the normal ``python`` interpreter. + .. _logging: https://docs.python.org/3/library/logging.html .. _@SpamBot: https://t.me/SpamBot .. _issue 297: https://github.com/LonamiWebs/Telethon/issues/297