From 50f2fb0f81c45135974182eb38196b334a976cfe Mon Sep 17 00:00:00 2001 From: Nekmo Date: Sun, 27 Feb 2022 05:19:27 +0100 Subject: [PATCH] Issue #131: Selective uploading option --- README.rst | 13 +++++++++---- docs/usage.rst | 32 +++++++++++++++++++++++++++++--- telegram_upload/management.py | 2 +- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index 940fec8c..451a7d0a 100644 --- a/README.rst +++ b/README.rst @@ -72,14 +72,19 @@ The ``--delete-on-success`` option allows you to delete the Telegram message aft useful to send files to download to your saved messages and avoid downloading them again. You can use this option to download files on your computer away from home. -The **interactive option** (``--interactive``) allows you to choose the dialog and the files to download with a -**terminal wizard**. It even **supports mouse**! +`Read the documentation `_ for more info. + + +Interactive mode +================ +The **interactive option** (``--interactive``) allows you to choose the dialog and the files to download or upload with +a **terminal wizard**. It even **supports mouse**! .. code-block:: console - $ telegram-download --interactive + $ telegram-upload --interactive # Interactive upload + $ telegram-download --interactive # Interactive download -`Read the documentation `_ for more info. Features diff --git a/docs/usage.rst b/docs/usage.rst index c271de58..215b15cc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -11,10 +11,14 @@ Usage :prog: telegram-download :show-nested: -Interactive download -==================== +Interactive mode +================ Use the ``-i`` (or ``--interactive``) option to activate the **interactive mode** to choose the dialog (chat, -channel...) and the files to download:: +channel...) and the files. To **upload files** using interactive mode: + + $ telegram-upload -i + +To **download files** using interactive mode: $ telegram-download -i @@ -28,6 +32,28 @@ The following keys are available in this mode: * **pageup**: go to the previous page of items. Allows quick navigation.. * **pagedown**: go to the next page of items. Allows quick navigation.. +Interactive upload +------------------ +This wizard has two steps. The *first step* chooses the files to upload. You can choose several files:: + + Select the local files to upload: + [SPACE] Select file [ENTER] Next step + [ ] myphoto1.jpg + [ ] myphoto2.jpg + [ ] myphoto3.jpg + +The *second step* chooses the conversation:: + + Select the dialog of the files to download: + [SPACE] Select dialog [ENTER] Next step + ( ) Groupchat 1 + ( ) Bob's chat + ( ) A channel + ( ) Me + + +Interactive download +-------------------- This wizard has two steps. The *first step* chooses the conversation:: Select the dialog of the files to download: diff --git a/telegram_upload/management.py b/telegram_upload/management.py index ec6b434f..e4b18d22 100644 --- a/telegram_upload/management.py +++ b/telegram_upload/management.py @@ -136,7 +136,7 @@ def upload(files, to, config, delete_on_success, print_file_id, force_file, forw client = Client(config or default_config(), proxy=proxy) client.start() if interactive and not files: - click.echo('Select the local filesto upload:') + click.echo('Select the local files to upload:') click.echo('[SPACE] Select file [ENTER] Next step') files = async_to_sync(interactive_select_local_files()) if interactive and to is None: