profile
viewpoint

paul-nameless/tg 168

terminal telegram client that really works

paul-nameless/nim-fswatch 9

Nim wrapper for the libfswatch

paul-nameless/pyfswatch 4

Python binding to libfswatch

paul-nameless/e2m 1

Sync emails to maildir

paul-nameless/nimbler 1

http/rest library to help write APIs in nim

paul-nameless/tg-dl 1

Telegram youtube/soundcloud downloader

paul-nameless/aioredis 0

asyncio (PEP 3156) Redis support

paul-nameless/auto-mode 0

Automatically switch macOS dark / light mode based on sunrise / sunset

paul-nameless/awesome-command-line-apps 0

:shell: Use your terminal shell to do awesome things.

paul-nameless/awesome-python 0

A curated list of awesome Python frameworks, libraries, software and resources

push eventpaul-nameless/tg

Paul Nameless

commit sha 5bf3f6279717b09ff2caea7b60e148c39bba00e5

Remove old way to count wide characters

view details

push time in 12 days

issue commentpaul-nameless/tg

Add a keybinding to download files

There is a keybinding D which downloads file and if you press y it will copy path to the file. All files are managed by tdlib and downloaded under FILES_DIR = os.path.expanduser("~/.cache/tg/") Files: ~/.cache/tg/files/

kovidgoyal

comment created time in 13 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 98edcae1c4f292b29501243c63c39c8a3a9af606

Update readme: remove virtualenv instructions

view details

push time in 13 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 4dc9b8ce253ff5877c661277d4a18820fdda1292

Update readme: use "pip install ." when installing from sources

view details

push time in 13 days

release paul-nameless/tg

v0.6.0

released time in 14 days

issue closedpaul-nameless/tg

Support for secret chats

I realize its on your TODO list, however, I'd like to now if it is likely to be implemented anytime soon. Thanks.

closed time in 14 days

kovidgoyal

created tagpaul-nameless/tg

tagv0.6.0

terminal telegram client that really works

created time in 14 days

push eventpaul-nameless/tg

Paul Nameless

commit sha be1ae815d25a16c7a23b5ac7b4f35ac92a9ff6ae

Rename mock->stub

view details

Paul Nameless

commit sha 87e50e10816654582d1d6d78317424dcabfd11f9

Release 0.6.0

view details

push time in 14 days

Pull request review commentpaul-nameless/tg

Fix hang when opened external app and resizing terminal

 def __init__(         self.msgs = msg_view         self.status = status_view         self.max_read = 2048+        self.resize_handler = self.resize++    def resize_mock(self) -> None:

You right, thanks

paul-nameless

comment created time in 14 days

PR opened paul-nameless/tg

Fix hang when opened external app and resizing terminal
+12 -4

0 comment

3 changed files

pr created time in 14 days

create barnchpaul-nameless/tg

branch : fix-hang

created branch time in 14 days

issue closedpaul-nameless/tg

View glitch

If I open message view and then press a to write a message this glitch appears: image

Is it known?

closed time in 14 days

jugendhacker

push eventpaul-nameless/tg

Paul Nameless

commit sha bf266c79998b7621d5cb601a27bdac49e37c7a44

Show chat info with <c> shortcut in msg panel

view details

Paul Nameless

commit sha 4c3ddbc8792299768338a25f73bc737f3e9d149a

Split big function into smaller

view details

Nameless

commit sha 44935ba908ee643dc8b1986942246c596fdadb16

Merge pull request #165 from paul-nameless/show-chat-info Show chat info with <c> shortcut in msg panel

view details

push time in 14 days

delete branch paul-nameless/tg

delete branch : show-chat-info

delete time in 14 days

PR merged paul-nameless/tg

Show chat info with <c> shortcut in msg panel

The main purpose of this patch is to be able to see encryption key of secret chats. Also, in the future showing chat members or chat files might be implemented.

+167 -23

0 comment

4 changed files

paul-nameless

pr closed time in 14 days

PR merged paul-nameless/tg

Fix drawing glitch with chat vertical separator

#96 Implemented correct double width character count which fixes error with failed msg draw when emojies didn't count correctly. Fixed glitch by drawing flags fristly and after that text message which made curses or terminal count correctly offset.

+46 -21

0 comment

2 changed files

paul-nameless

pr closed time in 14 days

delete branch paul-nameless/tg

delete branch : fix-glitch

delete time in 14 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 3a6814f3b0cdd98026d151f9f72a339a557af6d6

Fix drawing glitch with chat vertical separator

view details

Paul Nameless

commit sha 85811a50d979cb8ce8529d388570156b941e9ede

Use break in a loop

view details

Nameless

commit sha 5cf8ed016ff03060f8f7765878dd1a8db0b564b5

Merge pull request #166 from paul-nameless/fix-glitch Fix drawing glitch with chat vertical separator

view details

push time in 14 days

Pull request review commentpaul-nameless/tg

Fix drawing glitch with chat vertical separator

 def notify(     subprocess.Popen(notify_cmd, shell=True)  -def truncate_to_len(s: str, target_len: int) -> str:-    target_len -= sum(map(bool, map(emoji_pattern.findall, s[:target_len])))-    return s[: max(1, target_len - 1)]+def string_len_dwc(string: str) -> int:+    """Returns string len including count for double width characters"""+    return sum(1 + (unicodedata.east_asian_width(c) in "WF") for c in string)+++def truncate_to_len(string: str, width: int) -> str:+    real_len = string_len_dwc(string)+    if real_len <= width:+        return string

Suggest better alternative in other patch I would appreciate it.

paul-nameless

comment created time in 14 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 4c3ddbc8792299768338a25f73bc737f3e9d149a

Split big function into smaller

view details

push time in 14 days

Pull request review commentpaul-nameless/tg

Show chat info with <c> shortcut in msg panel

 def copy_msgs_text(self) -> bool:         copy_to_clipboard("\n".join(buffer))         return True +    def get_chat_info(self, chat: Dict[str, Any]) -> Dict[str, Any]:

Agree

paul-nameless

comment created time in 14 days

Pull request review commentpaul-nameless/tg

Show chat info with <c> shortcut in msg panel

 def __init__(self, model: Model, view: View, tg: Tdlib) -> None:         self.tg = tg         self.chat_size = 0.5 +    @bind(msg_handler, ["c"])

I think it should be in msg handler, because this is what follows official client logic. When you open chat and at the top there is a chat title, when you tap you see more info.

paul-nameless

comment created time in 14 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 85811a50d979cb8ce8529d388570156b941e9ede

Use break in a loop

view details

push time in 14 days

Pull request review commentpaul-nameless/tg

Fix drawing glitch with chat vertical separator

 def notify(     subprocess.Popen(notify_cmd, shell=True)  -def truncate_to_len(s: str, target_len: int) -> str:-    target_len -= sum(map(bool, map(emoji_pattern.findall, s[:target_len])))-    return s[: max(1, target_len - 1)]+def string_len_dwc(string: str) -> int:+    """Returns string len including count for double width characters"""+    return sum(1 + (unicodedata.east_asian_width(c) in "WF") for c in string)+++def truncate_to_len(string: str, width: int) -> str:+    real_len = string_len_dwc(string)+    if real_len <= width:+        return string

Doesn't look redundant for me

paul-nameless

comment created time in 14 days

push eventpaul-nameless/tg

jugendhacker

commit sha 6452604186fd319e7cbad0ecc7820f68e68dd3ab

Change AUR package to version following releases (#153) * Change from telegram-tg-git to telegram-tg * Add hint for developement version (telegram-tg-git)

view details

push time in 16 days

PR merged paul-nameless/tg

Change AUR package to version following releases
  • Change from telegram-tg-git to telegram-tg

  • Add hint for developement version (telegram-tg-git)

+4 -2

5 comments

1 changed file

jugendhacker

pr closed time in 16 days

pull request commentpaul-nameless/tg

Change AUR package to version following releases

Thanks for the patch! Release will be today-tomorrow.

jugendhacker

comment created time in 16 days

PR opened paul-nameless/tg

Fix drawing glitch with chat vertical separator

#96 Implemented correct double width character count which fixes error with failed msg draw when emojies didn't count correctly. Fixed glitch by drawing flags fristly and after that text message which made curses or terminal count correctly offset.

+45 -21

0 comment

2 changed files

pr created time in 16 days

create barnchpaul-nameless/tg

branch : fix-glitch

created branch time in 16 days

PR opened paul-nameless/tg

Show chat info with <c> shortcut in msg panel
+167 -23

0 comment

4 changed files

pr created time in 16 days

create barnchpaul-nameless/tg

branch : show-chat-info

created branch time in 16 days

push eventpaul-nameless/tg

Paul Nameless

commit sha fb11dafb3818678f75825b1364fbf5993b465485

Show user info

view details

Paul Nameless

commit sha d674c1d4303114535a599ffc072972500d01d796

Add block argument to get_user_full_info call

view details

Paul Nameless

commit sha 98dbd21beb5d991a1ee65da9855243820b24a4e6

Make consistent tdlib API

view details

Paul Nameless

commit sha 34a7ea0d4daed61f9baeda9f364b8ddce31c7942

Remove comma

view details

Nameless

commit sha ef09ba6e7b3dc453331f44d2e89d59833b632bf9

Show user info (#161) * Show user info * Add block argument to get_user_full_info call * Make consistent tdlib API

view details

push time in 17 days

delete branch paul-nameless/tg

delete branch : show-user-info

delete time in 17 days

PR merged paul-nameless/tg

Show user info
+76 -14

0 comment

3 changed files

paul-nameless

pr closed time in 17 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 34a7ea0d4daed61f9baeda9f364b8ddce31c7942

Remove comma

view details

push time in 17 days

Pull request review commentpaul-nameless/tg

Show user info

 def get_user(self, user_id: int) -> AsyncResult:         }         return self._send_data(data) -    def get_user_full_info(self, user_id: int) -> AsyncResult:+    def get_user_full_info(+        self, user_id: int, block: bool = False

I am not solving any problems, I want to keep API consistent. I have not problems with wait() and don't think it's complications or anything like that. But I agree, let's add things when we need it, I don't need block argument.

paul-nameless

comment created time in 18 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 98dbd21beb5d991a1ee65da9855243820b24a4e6

Make consistent tdlib API

view details

push time in 18 days

issue closedpaul-nameless/tg

Autocompletion when sending files and default file manager to pick

For example, when I send a picture with a name like ~/pics/soeasytomistypedir/pic1.jpg, I want to be able to auto-complete soeasytomistypedir. And when I choose something like ~/tmp/sdfskdjhsdkjfhsdfsdfsdf.stuff with many files having rubbish names in that dir, I want to use a file manager like ranger with preview feature to pick what I need.

closed time in 18 days

Yodzorah

delete branch paul-nameless/tg

delete branch : fix-resize-glitch

delete time in 18 days

push eventpaul-nameless/tg

Nameless

commit sha f94188a64dd0aadde866861a0cab6d2661048895

Fix invalid width count when resizing and terminal width is uneven (#164)

view details

push time in 18 days

PR merged paul-nameless/tg

Fix invalid width count when resizing and terminal width is uneven

When terminal size is uneven, e.g. 167 and width ratio equals 0.5 then we can notice glitch 167*0.5 = 83.5 round(167 * 0.5) = 84 84 + 84 = 168 As you can see, width of both panels (chat and msg) count incorrectly which leads to text overlap.

+8 -6

0 comment

2 changed files

paul-nameless

pr closed time in 18 days

Pull request review commentpaul-nameless/tg

Show user info

 def get_user(self, user_id: int) -> AsyncResult:         }         return self._send_data(data) -    def get_user_full_info(self, user_id: int) -> AsyncResult:+    def get_user_full_info(+        self, user_id: int, block: bool = False

I am trying to keep it as universal API that can be used with tdlib. According to documentation, there is an updateUserFullInfo method which might be used to get this method async. So actually, I'd remove block argument and make it with wait() or add **kwargs to each function (which will be passed to send_data) to make it consistent.

paul-nameless

comment created time in 18 days

PR opened paul-nameless/tg

Fix invalid width count when resizing and terminal width is uneven

When terminal size is uneven, e.g. 167 and width ratio equals 0.5 then we can notice glitch 167*0.5 = 83.5 round(167 * 0.5) = 84 84 + 84 = 168 As you can see, width of both panels (chat and msg) count incorrectly which leads to text overlap.

+8 -6

0 comment

2 changed files

pr created time in 19 days

create barnchpaul-nameless/tg

branch : fix-resize-glitch

created branch time in 19 days

push eventpaul-nameless/tg

Paul Nameless

commit sha d674c1d4303114535a599ffc072972500d01d796

Add block argument to get_user_full_info call

view details

push time in 19 days

Pull request review commentpaul-nameless/tg

Show user info

 def __init__(self, model: Model, view: View, tg: Tdlib) -> None:         self.tg = tg         self.chat_size = 0.5 +    @bind(msg_handler, ["u"])+    def user_innfo(self) -> None:

We know file path to profile, but it should be downloaded first I guess and it's not very user friendly to copy path to image. If we will implement curses based UI for user info in the future then we could do this.

paul-nameless

comment created time in 19 days

issue closedpaul-nameless/tg

Arch: various crashes on first run

crashes if .local/share/tg/all.log is missing

crashes if PHONE isn't in the correct format

closed time in 19 days

classabbyamp

push eventpaul-nameless/tg

Nameless

commit sha 7a9e31231ba09a1a6e4a0595fb2e6e9ea80b0247

Create directory for logs if missing (#162)

view details

push time in 19 days

delete branch paul-nameless/tg

delete branch : create-dir-for-logs

delete time in 19 days

push eventpaul-nameless/tg

Nameless

commit sha bb2d9b889ff1ec15da73f618459304967baf1549

Implement messageChatAddMembers, messageChatDeleteMember, messageBasicGroupChatCreate (#160) * Implement messageChatAddMembers, messageChatDeleteMember, messageBasicGroupChatCreate * Fix sort imports

view details

push time in 19 days

delete branch paul-nameless/tg

delete branch : messageChatDeleteMember

delete time in 19 days

issue openedreturntocorp/semgrep

Python parse error

Describe the bug

1 file(s) failed to parse: tg/models.py
ParseErrors:
--> Failed to parse tg/models.py:389 as python
        log.info(f"removing msg {msg_ids=}")
                                        ^
= note: If the code is correct, this could be a semgrep bug -- please help us fix this by filing an an issue at https://semgrep.dev
Run with --strict to exit with non-zero exit code when errors exist

To Reproduce Run semgrep --verbose --config=https://semgrep.live/c/p/python . with string formatting f"removing msg {msg_ids=}".

Expected behavior not fail with parse error

Screenshots

Environment local build

created time in 19 days

issue commentpaul-nameless/pyfswatch

AttributeError: dlsym(RTLD_DEFAULT, fsw_init_library): symbol not found

Hello, are you sure you have fswatch installed? brew install fswatch What version is it? Where is it installed (path to fswatch dylib)

ggmartins

comment created time in 19 days

issue closedpaul-nameless/tg

how to not auto download files.

the download thing is confusing for me. i know the 10MB limit,but sometimes less than 1MB picture is not downloaded but 5MB pdf file got downloaded.sometimes sticker is downloaded , sometimes not. i usually dont auto download anything. can you made on demand file download?

closed time in 19 days

harimurtie

issue commentpaul-nameless/tg

how to not auto download files.

Hello, You can set MAX_DOWNLOAD_SIZE = "0MB" in config file and it will prevent any file from been downloaded. When you need to download something, press D. Also, fyi, you can copy file path with y (yank).

harimurtie

comment created time in 19 days

Pull request review commentpaul-nameless/tg

Create directory for logs if missing

         if param.isupper():             globals()[param] = value else:-    for directory in (LOG_PATH, CONFIG_DIR, FILES_DIR):

As far as I can tell, tdlib creates directory if missing.

paul-nameless

comment created time in 19 days

create barnchpaul-nameless/tg

branch : create-dir-for-logs

created branch time in 19 days

PR opened paul-nameless/tg

Create directory for logs if missing
+3 -2

0 comment

2 changed files

pr created time in 19 days

PR opened paul-nameless/tg

Show user info
+67 -2

0 comment

3 changed files

pr created time in 19 days

create barnchpaul-nameless/tg

branch : show-user-info

created branch time in 19 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 77aae24678778121eb14bfd48b6ceeee945f99cb

Fix sort imports

view details

push time in 19 days

create barnchpaul-nameless/tg

branch : messageChatDeleteMember

created branch time in 19 days

issue commentpaul-nameless/tg

Arch: various crashes on first run

@classabbyamp were there any errors with missing ~/.cache/tg/ directory? Or only with local/share one?

classabbyamp

comment created time in 19 days

push eventpaul-nameless/tg

Nameless

commit sha 50b93eb3087c02af689246ba4816e1ebda31dc6f

Implement creating new group and secret chat ( #150) (#156) * Create new chat * Implement creating new group and secret chat, close secret chat when deleted to prevent showing again after restart * Update readme * Add doc strings, show error if fzf does not exist * Fix imports ordering

view details

push time in 19 days

delete branch paul-nameless/tg

delete branch : new-chat

delete time in 19 days

PR merged paul-nameless/tg

Implement creating new group and secret chat ( #150)
  • Create new chat
  • Implement creating new group and secret chat, close secret chat when deleted to prevent showing again after restart (#150)
+107 -53

0 comment

7 changed files

paul-nameless

pr closed time in 19 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 730b0a2a4212e1cbb49bcacb85d815df0eee5d20

Fix imports ordering

view details

push time in 20 days

push eventpaul-nameless/tg

Alex

commit sha 120d12cc4754faa1d8601be54cb9e549cc90f5ed

add setup.py (#155) * add setup.py * respond to comments

view details

Nameless

commit sha 9ee51c589ba018faa4a7d2737f9ac49d3c81d6e8

Add phone number information (#158)

view details

Nameless

commit sha 8ea48737805fa364c3d19cf9a736a27b9b2d4ab8

Add ability to view and send animation (GIFs) (#157) * Add ability to view and send animation (GIFs) * Fix black formatting

view details

Paul Nameless

commit sha e09b3070393b7fe80d6948e5f0700dd6567182ca

Merge branch 'master' into new-chat

view details

push time in 20 days

delete branch paul-nameless/tg

delete branch : add-animation-support

delete time in 20 days

push eventpaul-nameless/tg

Nameless

commit sha 8ea48737805fa364c3d19cf9a736a27b9b2d4ab8

Add ability to view and send animation (GIFs) (#157) * Add ability to view and send animation (GIFs) * Fix black formatting

view details

push time in 20 days

delete branch paul-nameless/tg

delete branch : phone-number-readme

delete time in 20 days

push eventpaul-nameless/tg

Nameless

commit sha 9ee51c589ba018faa4a7d2737f9ac49d3c81d6e8

Add phone number information (#158)

view details

push time in 20 days

PR merged paul-nameless/tg

Add phone number information

(#148)

+2 -1

2 comments

1 changed file

paul-nameless

pr closed time in 20 days

PR merged paul-nameless/tg

Reviewers
add setup.py
  • use setuptool instead of flit to remove flit as extra dependency during packaging
+32 -7

4 comments

3 changed files

lightme16

pr closed time in 20 days

delete branch paul-nameless/tg

delete branch : add-setup-py

delete time in 20 days

push eventpaul-nameless/tg

Alex

commit sha 120d12cc4754faa1d8601be54cb9e549cc90f5ed

add setup.py (#155) * add setup.py * respond to comments

view details

push time in 20 days

Pull request review commentpaul-nameless/tg

Add phone number information

 Config file should be stored at `~/.config/tg/conf.py`. This is simple python fi ### Simple config:  ```python-PHONE = "[your phone number]"+# should start with + (plus) and contain country code+PHONE = "[phone number in international format]"

That's an option but I don't want to add unnecessary logic. Tdlib will tell if phone number is incorrect don't think we need to validate it as well

paul-nameless

comment created time in 20 days

pull request commentpaul-nameless/tg

Add phone number information

Yes, I'll do it in separate patch

paul-nameless

comment created time in 20 days

pull request commentpaul-nameless/tg

Add ability to view and send animation (GIFs)

Checks are failing because of the bug in checkout@v2 plugin in actions, it's pulling previous commit. I hate this plugin

paul-nameless

comment created time in 20 days

push eventpaul-nameless/tg

Paul Nameless

commit sha e9fc5a351cf528fca5c59f4416ed6719bea73749

Add doc strings, show error if fzf does not exist

view details

push time in 20 days

PR opened paul-nameless/tg

Add phone number information

(#148)

+2 -1

0 comment

1 changed file

pr created time in 20 days

create barnchpaul-nameless/tg

branch : phone-number-readme

created branch time in 20 days

pull request commentpaul-nameless/tg

add setup.py

Make sure content type is set https://test.pypi.org/help/#description-content-type

I will test the upload through twine and remove flit from pyproject myself when it will work, so let's keep it for now.

lightme16

comment created time in 20 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 7f90c34baa8f2b747e4336c48eac41b78f30ec8a

Fix black formatting

view details

push time in 20 days

create barnchpaul-nameless/tg

branch : add-animation-support

created branch time in 20 days

issue commentpaul-nameless/tg

Arch: various crashes on first run

What was the problem with PHONE format?

classabbyamp

comment created time in 20 days

issue commentpaul-nameless/tg

Ability to view pictures in the context of chat messages

I made a fast PoC. so it's working but to make it "production" ready there is a good amount of code to rewrite. Screen Shot 2020-07-22 at 12 18 58 PM

Yodzorah

comment created time in 20 days

issue closedpaul-nameless/tg

Feature request: inline images and stickers

kitty support images inline natively

ranger uses w3m to show images

closed time in 20 days

classabbyamp

issue commentpaul-nameless/tg

Feature request: inline images and stickers

Duplicate of #137

classabbyamp

comment created time in 20 days

issue commentpaul-nameless/tg

Arch: various crashes on first run

It should create log directory at first run if no configuration file detected https://github.com/paul-nameless/tg/blob/master/tg/config.py

I guess you've had config file already?

classabbyamp

comment created time in 20 days

issue closedpaul-nameless/tg

Glitch in Insert mode

Not sure how to reproduce, but this is what I did:

  1. Open tg, open tg's official group chat.
  2. Press i, start typing a message in Russian, pause, but don't send it yet.
  3. Wait for the 'blink' (suppose, that's when tg updates messages and chats).
  4. Right after the 'blink' happens, tg looks like this:

telegram-tg visual glitch

  1. Easily cured by typing another character into the still focused input field, the whole app comes back to the way it was, everything readable and as it should be.

Maybe it's related to #96?

closed time in 20 days

Yodzorah

issue commentpaul-nameless/tg

Glitch in Insert mode

This bug should be fixed in the latest version, at least I haven't seen it anymore, reopen if it will happen again, please.

Yodzorah

comment created time in 20 days

push eventpaul-nameless/tg

Paul Nameless

commit sha 9ca02c55ab59c99d97e01356bed766b0665d02c3

Update readme

view details

push time in 20 days

PR opened paul-nameless/tg

new chat
  • Create new chat
  • Implement creating new group and secret chat, close secret chat when deleted to prevent showing again after restart
+98 -47

0 comment

5 changed files

pr created time in 20 days

create barnchpaul-nameless/tg

branch : new-chat

created branch time in 20 days

more