diff --git a/aiogram/types/input_file.py b/aiogram/types/input_file.py index d9db96d5..9c323627 100644 --- a/aiogram/types/input_file.py +++ b/aiogram/types/input_file.py @@ -20,6 +20,13 @@ class InputFile(ABC): """ def __init__(self, filename: Optional[str] = None, chunk_size: int = DEFAULT_CHUNK_SIZE): + """ + Base class for input files. Should not be used directly. + Look at :class:`BufferedInputFile`, :class:`FSInputFile` :class:`URLInputFile` + + :param filename: name of the given file + :param chunk_size: reader chunks size + """ self.filename = filename self.chunk_size = chunk_size diff --git a/docs2/_static/stylesheets/extra.css b/docs2/_static/stylesheets/extra.css index 3a25e21e..3a9ee46a 100644 --- a/docs2/_static/stylesheets/extra.css +++ b/docs2/_static/stylesheets/extra.css @@ -14,3 +14,9 @@ code, kbd, pre { .highlight * { background: #f0f0f0; } + +@media (prefers-color-scheme: dark) { + .highlight * { + background: #424242; + } +} \ No newline at end of file diff --git a/docs2/api/types/input_file.rst b/docs2/api/types/input_file.rst index f206221d..8a7b1fce 100644 --- a/docs2/api/types/input_file.rst +++ b/docs2/api/types/input_file.rst @@ -4,8 +4,28 @@ InputFile This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser. -.. automodule:: aiogram.types.input_file +Read more at :doc:`../upload_file.rst` + +.. autoclass:: aiogram.types.input_file.InputFile :members: :member-order: bysource :special-members: __init__ - :undoc-members: True \ No newline at end of file + :undoc-members: True + +.. autoclass:: aiogram.types.input_file.BufferedInputFile + :members: + :member-order: bysource + :special-members: __init__ + :undoc-members: True + +.. autoclass:: aiogram.types.input_file.FSInputFile + :members: + :member-order: bysource + :special-members: __init__ + :undoc-members: True + +.. autoclass:: aiogram.types.input_file.URLInputFile + :members: + :member-order: bysource + :special-members: __init__ + :undoc-members: True diff --git a/docs2/conf.py b/docs2/conf.py index 8ba3d124..42ace9f6 100644 --- a/docs2/conf.py +++ b/docs2/conf.py @@ -25,6 +25,7 @@ extensions = [ "sphinx.ext.viewcode", "sphinx.ext.autodoc", "sphinx.ext.ifconfig", + "sphinx.ext.intersphinx", "sphinx-prompt", "sphinx_substitution_extensions", "sphinx_copybutton", diff --git a/docs2/install.rst b/docs2/install.rst index d6ea8c79..c9e1cfe3 100644 --- a/docs2/install.rst +++ b/docs2/install.rst @@ -28,12 +28,22 @@ Using Pipenv pipenv install aiogram -Using AUR ---------- -*aiogram* is also available in Arch User Repository, so you can install this framework on any -Arch-based distribution like ArchLinux, Antergos, Manjaro, etc. To do this, use your favorite -AUR-helper and install `python-aiogram `_ package. +Using poetry +------------ +.. code-block:: bash + + poetry add aiogram + +Using Pacman +------------ +*aiogram* is also available in Arch Linux Repository, so you can install this framework on any +Arch-based distribution like Arch Linux, Antergos, Manjaro, etc. To do this, just use pacman +to install the `python-aiogram `_ package: + +.. code-block:: bash + + pacman -S python-aiogram Development build (3.x) ======================= diff --git a/poetry.lock b/poetry.lock index bb48147b..3925d234 100644 --- a/poetry.lock +++ b/poetry.lock @@ -43,7 +43,7 @@ name = "alabaster" version = "0.7.12" description = "A configurable sidebar-enabled Sphinx theme" category = "main" -optional = true +optional = false python-versions = "*" [[package]] @@ -144,7 +144,7 @@ name = "beautifulsoup4" version = "4.9.3" description = "Screen-scraping library" category = "main" -optional = true +optional = false python-versions = "*" [package.dependencies] @@ -240,7 +240,7 @@ name = "docutils" version = "0.16" description = "Docutils -- Python Documentation Utilities" category = "main" -optional = true +optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] @@ -284,7 +284,7 @@ name = "furo" version = "2020.12.30b24" description = "A clean customisable Sphinx documentation theme." category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.dependencies] @@ -327,7 +327,7 @@ name = "imagesize" version = "1.2.0" description = "Getting image size from png/jpeg/jpeg2000/gif file" category = "main" -optional = true +optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [[package]] @@ -919,7 +919,7 @@ pytest = ">=3.5" [[package]] name = "python-socks" -version = "1.1.2" +version = "1.2.0" description = "Core proxy (SOCKS4, SOCKS5, HTTP tunneling) functionality for Python" category = "main" optional = false @@ -962,7 +962,7 @@ name = "requests" version = "2.15.1" description = "Python HTTP for Humans." category = "main" -optional = true +optional = false python-versions = "*" [package.extras] @@ -982,7 +982,7 @@ name = "snowballstemmer" version = "2.0.0" description = "This package provides 26 stemmers for 25 languages generated from Snowball algorithms." category = "main" -optional = true +optional = false python-versions = "*" [[package]] @@ -990,7 +990,7 @@ name = "soupsieve" version = "2.1" description = "A modern CSS selector implementation for Beautiful Soup." category = "main" -optional = true +optional = false python-versions = ">=3.5" [[package]] @@ -998,7 +998,7 @@ name = "sphinx" version = "3.4.3" description = "Python documentation generator" category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.dependencies] @@ -1029,7 +1029,7 @@ name = "sphinx-autobuild" version = "2020.9.1" description = "Rebuild Sphinx documentation on changes, with live-reload in the browser." category = "main" -optional = true +optional = false python-versions = ">=3.6" [package.dependencies] @@ -1044,7 +1044,7 @@ name = "sphinx-copybutton" version = "0.3.1" description = "Add a copy button to each of your code cells." category = "main" -optional = true +optional = false python-versions = "*" [package.dependencies] @@ -1058,7 +1058,7 @@ name = "sphinx-intl" version = "2.0.1" description = "Sphinx utility that make it easy to translate and to apply translation." category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.dependencies] @@ -1075,7 +1075,7 @@ name = "sphinx-prompt" version = "1.3.0" description = "Sphinx directive to add unselectable prompt" category = "main" -optional = true +optional = false python-versions = "*" [package.dependencies] @@ -1087,7 +1087,7 @@ name = "sphinx-substitution-extensions" version = "2020.9.30.0" description = "Extensions for Sphinx which allow for substitutions." category = "main" -optional = true +optional = false python-versions = "*" [package.dependencies] @@ -1103,7 +1103,7 @@ name = "sphinxcontrib-applehelp" version = "1.0.2" description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.extras] @@ -1115,7 +1115,7 @@ name = "sphinxcontrib-devhelp" version = "1.0.2" description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.extras] @@ -1127,7 +1127,7 @@ name = "sphinxcontrib-htmlhelp" version = "1.0.3" description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.extras] @@ -1139,7 +1139,7 @@ name = "sphinxcontrib-jsmath" version = "1.0.1" description = "A sphinx extension which renders display math in HTML via JavaScript" category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.extras] @@ -1150,7 +1150,7 @@ name = "sphinxcontrib-qthelp" version = "1.0.3" description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.extras] @@ -1162,7 +1162,7 @@ name = "sphinxcontrib-serializinghtml" version = "1.1.4" description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." category = "main" -optional = true +optional = false python-versions = ">=3.5" [package.extras] @@ -1295,7 +1295,7 @@ proxy = ["aiohttp-socks"] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "d8162cc56fb0d88ad6310aae6cf96d459bc8565aa7630147930f634655c07cf5" +content-hash = "de33cdffd99e2fde96d71773dedf7f6786fe0aabed7a92eed921ecbea1477a70" [metadata.files] aiofiles = [ @@ -1828,8 +1828,8 @@ pytest-mypy = [ {file = "pytest_mypy-0.8.0-py3-none-any.whl", hash = "sha256:8d2112972c1debf087943f48963a0daf04f3424840aea0cf437cc97053b1b0ef"}, ] python-socks = [ - {file = "python-socks-1.1.2.tar.gz", hash = "sha256:fa7513c9293d95d90b1da9e10b84fa53afcb4c0f67e9c141d9f479cde2d8af1a"}, - {file = "python_socks-1.1.2-py3-none-any.whl", hash = "sha256:4390882760ae60b14615f951aac3ef2e9eab45eb33ed8e7ed02d9b4dfb3b5640"}, + {file = "python-socks-1.2.0.tar.gz", hash = "sha256:3054a8afa984a35144198e00fed1144eeae3287cc231ac7db3908d32ab642cd4"}, + {file = "python_socks-1.2.0-py3-none-any.whl", hash = "sha256:26e45b29e18ab7a28ad646e82d3e47a32fe13942b0b1c75ae3f6fe9e5c03efcb"}, ] pytz = [ {file = "pytz-2020.5-py2.py3-none-any.whl", hash = "sha256:16962c5fb8db4a8f63a26646d8886e9d769b6c511543557bc84e9569fb9a9cb4"},