Skip to content

Commit

Permalink
Merge pull request #43 from erayerdin/development
Browse files Browse the repository at this point in the history
v0.4.0pre3
  • Loading branch information
erayerdin committed Apr 17, 2020
2 parents 3747378 + 5efed05 commit 2a9617a
Show file tree
Hide file tree
Showing 19 changed files with 179 additions and 660 deletions.
3 changes: 3 additions & 0 deletions .flake8
@@ -0,0 +1,3 @@
[flake8]
max-line-length = 160
ignore = E231
7 changes: 7 additions & 0 deletions .isort.cfg
@@ -0,0 +1,7 @@
[settings]
known_third_party = click,colorful,pytest,requests,requests_mock,setuptools,yaspin
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
25 changes: 25 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,25 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/python/black
rev: master
hooks:
- id: black
- repo: https://github.com/asottile/seed-isort-config
rev: master
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: master
hooks:
- id: isort
- repo: https://gitlab.com/pycqa/flake8
rev: '3.7.9'
hooks:
- id: flake8
16 changes: 9 additions & 7 deletions .travis.yml
Expand Up @@ -8,36 +8,38 @@ jobs:
python: '3.7'
install:
- pip install -r requirements.txt
- pip install -r dev.requirements.txt
- pip install black
# ref: https://stackoverflow.com/a/54053100/2926992
- cat dev.requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install || true
script:
- black setup.py tests/ tgcli/ -l 79
- black setup.py tests/ tgcli/
- flake8 setup.py tests/ tgcli/
- isort -c
- stage: Testing
python: '3.5'
install:
- pip install -r requirements.txt
- pip install -r dev.requirements.txt
- cat dev.requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install || true
script:
- pytest
- stage: Testing
python: '3.6'
install:
- pip install -r requirements.txt
- pip install -r dev.requirements.txt
- cat dev.requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install || true
script:
- pytest
- stage: Testing
python: '3.7'
install:
- pip install -r requirements.txt
- pip install -r dev.requirements.txt
- cat dev.requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install || true
script:
- pytest
- stage: Covering / Deploy
python: '3.7'
install:
- pip install -r requirements.txt
- pip install -r dev.requirements.txt
- cat dev.requirements.txt | sed -e '/^\s*#.*$/d' -e '/^\s*$/d' | xargs -n 1 pip install || true
script:
- pytest --cov-config .coveragerc --cov tgcli tests/
- coveralls
Expand Down
9 changes: 5 additions & 4 deletions .vscode/settings.json
@@ -1,7 +1,7 @@
{
"python.linting.enabled": true,
"python.linting.pep8Enabled": false,
"python.linting.pylintEnabled": true,
"python.linting.pycodestyleEnabled": false,
"python.linting.pylintEnabled": false,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
Expand All @@ -15,5 +15,6 @@
".pytest_cache": true
},
"explorerExclude.backup": null,
"python.pythonPath": ".venv/bin/python3.7"
}
"python.pythonPath": ".venv/bin/python",
"python.linting.flake8Enabled": true
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.4.0pre3] - 2020-04-17
### Changed
- `--horizontal/-h` and `--vertical/-v` flags for `bot send video` has been
changed to `--width/-w` ad `--height/-h`.
- Default values for `--width/-w` and `--height/-h` flags on `bot send video`
has been set to `1920` and `1080`.
- Various bug fixes.

## [v0.3.1] - 2019-09-22
### Changed
- The description of `--horizontal` and `--vertical` options on `bot send video`
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
@@ -1,4 +1,4 @@
Copyright 2019 Eray Erdin
Copyright 2020 Eray Erdin

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
82 changes: 36 additions & 46 deletions README.md
@@ -1,34 +1,57 @@
# tgcli

[![PyPI](https://img.shields.io/pypi/v/tgcli.svg?style=flat-square&logo=python&logoColor=white)][pypi_url]
[![PyPI](https://img.shields.io/pypi/dm/tgcli.svg?style=flat-square&logo=python&logoColor=white)][pypi_url]
[![PyPI](https://img.shields.io/pypi/pyversions/tgcli.svg?style=flat-square&logo=python&logoColor=white)][pypi_url]
[![PyPI](https://img.shields.io/pypi/l/tgcli.svg?style=flat-square)][pypi_url]
[![](https://img.shields.io/readthedocs/tgcli.svg?style=flat-square)](https://tgcli.readthedocs.io/en/latest/)
[![Telegram](https://img.shields.io/badge/telegram-%40erayerdin-%2332afed.svg?style=flat-square&logo=telegram&logoColor=white)](https://t.me/erayerdin)
[![Code Style](https://img.shields.io/badge/style-black-000000.svg?style=flat-square)](https://github.com/ambv/black)
[![PyPI - Version][badge_version]][pypi_url]
[![PyPI - Downloads Last Month][badge_downloads]][pypi_url]
[![PyPI - Python Versions][badge_pyversions]][pypi_url]
[![PyPI - License][badge_license]][pypi_url]
[![Docs Status][badge_docs]][docs_url]
[![Code Style][badge_style]](https://github.com/ambv/black)

![](resources/recording.gif)

`tgcli` is a Python cli app for Telegram.

[pypi_url]: https://pypi.org/project/tgcli/
[docs_url]: https://tgcli.readthedocs.io

[badge_version]: https://img.shields.io/pypi/v/tgcli.svg?style=flat-square&logo=python&logoColor=white
[badge_downloads]: https://img.shields.io/pypi/dm/tgcli.svg?style=flat-square&logo=python&logoColor=white
[badge_pyversions]: https://img.shields.io/pypi/pyversions/tgcli.svg?style=flat-square&logo=python&logoColor=white
[badge_license]: https://img.shields.io/pypi/l/tgcli.svg?style=flat-square
[badge_docs]: https://img.shields.io/readthedocs/tgcli?style=flat-square
[badge_style]: https://img.shields.io/badge/style-black-000000.svg?style=flat-square


| | Build | Coverage |
|--------------|-------|----------|
| **Master** | [![Travis (.com) master](https://img.shields.io/travis/com/erayerdin/tgcli/master.svg?style=flat-square&logo=travis&logoColor=white)][travis_url] | [![](https://img.shields.io/coveralls/github/erayerdin/tgcli/master.svg?logo=star&logoColor=white&style=flat-square)][coveralls_url] |
| **Development** | [![Travis (.com) development](https://img.shields.io/travis/com/erayerdin/tgcli/development.svg?style=flat-square&logo=travis&logoColor=white)][travis_url] | [![](https://img.shields.io/coveralls/github/erayerdin/tgcli/development.svg?logo=star&logoColor=white&style=flat-square)][coveralls_url] |
| **Master** | [![Master Build][badge_build_master]][build_url] | [![Master Coverage][badge_coverage_master]][coverage_url] |
| **Development** | [![Development Build][badge_build_development]][build_url] | [![Development Coverage][badge_coverage_development]][coverage_url] |

[build_url]: https://travis-ci.com/erayerdin/tgcli
[coverage_url]: https://coveralls.io/github/erayerdin/tgcli

[travis_url]: https://travis-ci.com/erayerdin/tgcli
[coveralls_url]: https://coveralls.io/github/erayerdin/tgcli
[badge_build_master]: https://img.shields.io/travis/com/erayerdin/tgcli/master.svg?style=flat-square&logo=travis&logoColor=white
[badge_build_development]: https://img.shields.io/travis/com/erayerdin/tgcli/development.svg?style=flat-square&logo=travis&logoColor=white
[badge_coverage_master]: https://img.shields.io/coveralls/github/erayerdin/tgcli/master.svg?logo=star&logoColor=white&style=flat-square
[badge_coverage_development]: https://img.shields.io/coveralls/github/erayerdin/tgcli/development.svg?logo=star&logoColor=white&style=flat-square

## Installing

### pip (No auto-update)

Install via `pip`:

```bash
pip install tgcli
```
### tgcli (Auto-update, Arch-based)

Also available as a package in [AUR](https://aur.archlinux.org/packages/tgcli/).

```bash
# assuming you use yay
yay -S tgcli
```

## Rationale

Expand All @@ -38,7 +61,7 @@ pip install tgcli

For now, the use case is pretty simple. To send a message:

```python
```bash
tgcli bot --token "BotToken" send --receiver "UserID" message "Your message"
```

Expand Down Expand Up @@ -67,37 +90,4 @@ breaking changes in the future.

Documentation has an intensive amount of information about how to
use `tgcli`. Refer to the
[documentation](https://tgcli.readthedocs.io/en/latest/).

## Donations

`tgcli` is a free (as in beer and speech) software that I have
built in my leisure time and been maintaining it. If you like to
use it, please consider a small donation.

### How do I donate?

I accept donations in:

- MiliBitcoin (mBTC)
- Monero (XMR)

You can donate predefined (*almost* $1) or custom donation by
clicking or scanning below.

| | Predefined (*Almost* $1) | How Much You Wish |
|-|--------------------------|-------------------|
| MiliBitcoin (mBTC) | [![mBTC predefined][mbtc_d1_qr]][mbtc_d1] | [![mBTC custom][mbtc_custom_qr]][mbtc_custom] |
| Monero (XMR) | [![XMR predefined][xmr_d1_qr]][xmr_d1] | [![XMR custom][xmr_custom_qr]][xmr_custom]

[mbtc_d1]: bitcoin:bc1qpjqftgzvr2cstrn7lkfl7q84h0uq6k806cv9md?amount=0.00009732&message=For%20%22tgcli%22%20as%20my%20gratitude.&time=1568582579
[mbtc_d1_qr]: docs/img/mbtc_d1_qr.png

[mbtc_custom]: bitcoin:bc1qcywffxwa0rxsszgm07cyvsksxm3jxqj8z80ezh?message=For%20%22tgcli%22%20as%20my%20gratitude.&time=1568746229
[mbtc_custom_qr]: docs/img/mbtc_custom_qr.png

[xmr_d1]: monero://44Fs67hkoVxA9xrcLHTS4zfcYehBtzxo8LLcNWWaJ1HHT6SA6FN6aqai4QKfY7gU6TL65Pp46ov1aBy4E6jpV7ohRyfFbBr?tx_amount=0.015&tx_message=For%20%22tgcli%22%20as%20my%20gratitude.
[xmr_d1_qr]: docs/img/xmr_d1_qr.png

[xmr_custom]: monero://44Fs67hkoVxA9xrcLHTS4zfcYehBtzxo8LLcNWWaJ1HHT6SA6FN6aqai4QKfY7gU6TL65Pp46ov1aBy4E6jpV7ohRyfFbBr?tx_message=For%20%22tgcli%22%20as%20my%20gratitude.
[xmr_custom_qr]: docs/img/xmr_custom_qr.png
[documentation][docs_url].
10 changes: 7 additions & 3 deletions dev.requirements.txt
@@ -1,7 +1,11 @@
pytest==4.1.1
pytest-cov==2.6.1
coveralls==1.5.1
pytest==5.4.1
requests-mock==1.5.2
mkdocs==1.0.4
mkdocs-material==4.1.1
pytest-click==0.3
pytest-cov==2.8.1
coveralls==2.0.0
black==19.10b0
flake8==3.7.9
isort==4.3.21
pre-commit==2.2.0
15 changes: 8 additions & 7 deletions docs/bot.md
Expand Up @@ -174,20 +174,21 @@ through `tgcli`. To get help:
Short Flag | Full Flag | Required/Optional | Description
--- | --- | --- | ---
-m | --message | Optional | The message.
-h | --horizontal | Optional | The horizontal aspect ratio of video.
-v | --vertical | Optional | The vertical aspect ratio of video.
-w | --width | Optional | The width of the video.
-v | --vertical | Optional | The height of the video.
| file | Required | Path to file.

The usage is similar to the usage of [document](bot.md#document).

!!! warning
Telegram server assumes the aspect ratio of video as 1:1
for thumbnail due to performance reasons. See
[this issue][issue_27] for an example. That's why it is good
to know the aspect ratio of the video beforehand. Standards
are `16:9` for new videos and `4:3` for old videos.
Defining width and height with their related flags do not
actually change your video content. It only shapes the
video container with the aspect ratio of the width and
height in the application. For more information, see
[#27][issue_27] and [#40][issue_40].

[issue_27]: https://github.com/erayerdin/tgcli/issues/27
[issue_40]: https://github.com/erayerdin/tgcli/issues/40

### audio

Expand Down
Binary file added resources/coogger.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a9617a

Please sign in to comment.