# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['tg']

package_data = \
{'': ['*'], 'tg': ['resources/*']}

install_requires = \
['python-telegram==0.14.0']

entry_points = \
{'console_scripts': ['tg = tg.__main__:main']}

setup_kwargs = {
    'name': 'tg',
    'version': '0.18.0',
    'description': 'Terminal Telegram client',
    'long_description': '# tg\n\n[![Join telegram chat](https://img.shields.io/badge/telegram-join%20chat-black.svg)](https://t.me/tg_term)\n\nTelegram terminal client.\n\n![tg screenshot](tg-screenshot.png)\n\n\n## Features\n\n- [X] view mediafiles: photo, video, voice/video notes, documents\n- [X] ability to send pictures, documents, audio, video\n- [X] reply, edit, forward, delete, send messages\n- [X] stickers\n- [X] notifications\n- [X] record and send voice msgs\n- [X] auto download files\n- [X] toggle chats: pin/unpin, mark as read/unread, mute/unmute\n- [X] message history\n- [X] list contacts\n- [X] show user status\n- [X] secret chats\n- [ ] search\n- [ ] bots (bot keyboard)\n\n\n## Requirements\n\nTo use tg, you\'ll need to have the following installed:\n\n- [Python >= 3.8](https://www.python.org/downloads/)\n\n\n## Optional dependencies\n\n- [terminal-notifier](https://github.com/julienXX/terminal-notifier) - for Mac (used by default). You can change it to [dunst](https://github.com/dunst-project/dunst) for Linux or any other notifications program (see `NOTIFY_CMD` in configuration)\n- [ffmpeg](https://ffmpeg.org/) - to record voice msgs and upload videos.\n- [tdlib](https://tdlib.github.io/td/build.html?language=Python) - in case of incompatibility with built in package.\n  For example, macOS:\n  ```sh\n  brew install tdlib\n  ```\n  and then set in config `TDLIB_PATH`\n- `urlview` to choose urls when there is multiple in message, use `URL_VIEW` in config file to use another app (it should accept urls in stdin)\n- to open `stickers` and `animated` ones (thumbnail preview) you need to set in mailcap appropriate handler and have app which will open `webp` file:\n  ```ini\n  image/webp; mpv %s\n  ```\n- [ranger](https://github.com/ranger/ranger), [nnn](https://github.com/jarun/nnn) - can be used to choose file when sending, customizable with `FILE_PICKER_CMD`\n- [fzf](https://github.com/junegunn/fzf) - to create groups and secret chats (used for single and multiple user selection)\n\n## Installation\n\n### From PyPI\n\nThis option is recommended for production:\n\n```sh\npip3 install tg\ntg\n```\n\n### Homebrew\n\n```sh\nbrew tap paul-nameless/homebrew-repo\nbrew install tg\n```\n\n### From sources\n\nThis option is recommended for development:\n\n```sh\ngit clone https://github.com/paul-nameless/tg.git\ncd tg\npip install python-telegram\npip install .\ntg\n```\n\n### Using Docker\n\n> Note that voice recordings and notifications won\'t work when using Docker.\n\n```sh\ndocker run -it --rm ghcr.io/paul-nameless/tg\n```\n\n### From the AUR\n\nIf you\'re using Arch Linux, you can install tg through [its AUR package](https://aur.archlinux.org/packages/telegram-tg/):\n\nIf you\'re using the `yay` AUR helper, you can install the package with:\n```bash\nyay -S telegram-tg\n```\n\nIf you want to use the latest developement version via the AUR you can find it [here](https://aur.archlinux.org/packages/telegram-tg-git/)\n\n## Configuration\n\nConfig file should be stored at `~/.config/tg/conf.py`. This is simple python file.\n\n### Simple config:\n\n```python\n# should start with + (plus) and contain country code\nPHONE = "[phone number in international format]"\n```\n\n### Advanced configuration:\n\nAll configurable variables can be found [here](https://github.com/paul-nameless/tg/blob/master/tg/config.py)\n\n```python\nimport os\n\n# You can write anything you want here, file will be executed at start time\n# You can keep you sensitive information in password managers or gpg\n# encrypted files for example\ndef get_pass(key):\n    # retrieves key from password store\n    return os.popen("pass show {} | head -n 1".format(key)).read().strip()\n\n\nPHONE = get_pass("i/telegram-phone")\n# encrypt you local tdlib database with the key\nENC_KEY = get_pass("i/telegram-enc-key")\n\n# log level for debugging, info by default\nLOG_LEVEL = "DEBUG"\n# path where logs will be stored (all.log and error.log)\nLOG_PATH = os.path.expanduser("~/.local/share/tg/")\n\n# If you have problems with tdlib shipped with the client, you can install and\n# use your own, for example:\nTDLIB_PATH = "/usr/local/Cellar/tdlib/1.6.0/lib/libtdjson.dylib"\n\n# you can use any other notification cmd, it is simple python string which\n# can format title, msg, subtitle and icon_path paramters\n# In these exapmle, kitty terminal is used and when notification is pressed\n# it will focus on the tab of running tg\nNOTIFY_CMD = "/usr/local/bin/terminal-notifier -title {title} -subtitle {subtitle} -message {msg} -appIcon {icon_path} -sound default -execute \'/Applications/kitty.app/Contents/MacOS/kitty @ --to unix:/tmp/kitty focus-tab --no-response -m title:tg\'"\n\n# You can use your own voice recording cmd but it\'s better to use default one.\n# The voice note must be encoded with the Opus codec, and stored inside an OGG\n# container. Voice notes can have only a single audio channel.\nVOICE_RECORD_CMD = "ffmpeg -f avfoundation -i \':0\' -c:a libopus -b:a 32k {file_path}"\n\n# You can customize chat and msg flags however you want.\n# By default words will be used for readability, but you can make\n# it as simple as one letter flags like in mutt or add emojies\nCHAT_FLAGS = {\n    "online": "●",\n    "pinned": "P",\n    "muted": "M",\n    # chat is marked as unread\n    "unread": "U",\n    # last msg haven\'t been seen by recipient\n    "unseen": "✓",\n    "secret": "🔒",\n    "seen": "✓✓",  # leave empty if you don\'t want to see it\n}\nMSG_FLAGS = {\n    "selected": "*",\n    "forwarded": "F",\n    "new": "N",\n    "unseen": "U",\n    "edited": "E",\n    "pending": "...",\n    "failed": "💩",\n    "seen": "✓✓",  # leave empty if you don\'t want to see it\n}\n\n# use this app to open url when there are multiple\nURL_VIEW = \'urlview\'\n\n# Specifies range of colors to use for drawing users with\n# different colors\n# this one uses base 16 colors which should look good by default\nUSERS_COLORS = tuple(range(2, 16))\n\n# to use 256 colors, set range appropriately\n# though 233 looks better, because last colors are black and gray\n# USERS_COLORS = tuple(range(233))\n\n# to make one color for all users\n# USERS_COLORS = (4,)\n\n# cleanup cache\n# Values: N days, None (never)\nKEEP_MEDIA = 7\n\nFILE_PICKER_CMD = "ranger --choosefile={file_path}"\n# FILE_PICKER_CMD = "nnn -p {file_path}"\n\nMAILCAP_FILE = os.path.expanduser("~/.config/mailcap")\n\nDOWNLOAD_DIR = os.path.expanduser("~/Downloads/")  # copy file to this dir\n```\n\n### Mailcap file\n\nMailcap file is used for deciding how to open telegram files (docs, pics, voice notes, etc.). Path to the file can be overriden with `MAILCAP_FILE` in config file.\n\nExample: `~/.mailcap`\n\n```ini\n# media\nvideo/*; mpv "%s"\naudio/ogg; mpv --speed=1.33 "%s"\naudio/mpeg; mpv --no-video "%s"\nimage/*; qview "%s"\n\n# text\ntext/html; w3m "%s"\ntext/html; open -a Firefox "%s"\ntext/plain; less "%s"\n\n# fallback to vim\ntext/*; vim "%s"\n```\n\n\n## Keybindings\n\nvi like keybindings are used in the project. Can be used commands like `4j` - 4 lines down.\n\nFor navigation arrow keys also can be used.\n\n### Chats:\n\n- `j,k`: move up/down\n- `J,K`: move 10 chats up/down\n- `g`: go to top chat\n- `l`: open msgs of the chat\n- `m`: mute/unmute current chat\n- `p`: pin/unpin current chat\n- `u`: mark read/unread\n- `r`: read current chat\n- `c`: show list of contacts\n- `dd`: delete chat or remove history\n- `ng`: create new group chat\n- `ns`: create new secret chat\n- `/`: search in chats\n- `?`: show help\n\n## Msgs:\n\n- `j,k`: move up/down\n- `J,K`: move 10 msgs up/down\n- `G`: move to the last msg (at the bottom)\n- `D`: download file\n- `l`: if video, pics or audio then open app specified in mailcap file, for example:\n  ```ini\n  # Images\n  image/png; qView "%s"\n  audio/*; mpv "%s"\n  ```\n  if text, open in `less` (to view multiline msgs)\n- `e`: edit current msg\n- `<space>`: select msg and jump one msg down (use for deletion or forwarding)\n- `<ctrl+space>`: same as space but jumps one msg up\n- `y`: yank (copy) selected msgs with <space> to internal buffer (for forwarding) and copy current msg text or path to file to clipboard\n- `p`: forward (paste) yanked (copied) msgs to current chat\n- `dd`: delete msg for everybody (multiple messages will be deleted if selected)\n- `i or a`: insert mode, type new message\n- `I or A`: open vim to write long msg and send\n- `v`: record and send voice message\n- `r,R`: reply to a current msg\n- `S`: calls a file picker\n- `sv`: send video\n- `sa`: send audio\n- `sp`: send picture\n- `sd`: send document\n- `o`: open url present in message (if multiple urls, `urlview` will be opened)\n- `]`: next chat\n- `[`: prev chat\n- `u`: show user info (username, bio, phone, etc.)\n- `c`: show chat info (e.g. secret chat encryption key, chat id, state, etc.)\n- `?`: show help\n- `!`: open msg with custom cmd\n\n## Publish\n\nRun script to automatically increase version and release\n\n```sh\n./do release\n```\n',
    'author': 'Paul Nameless',
    'author_email': 'reacsdas@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/paul-nameless/tg',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.8,<4.0',
}


setup(**setup_kwargs)
