From 1509f301f3cc842ccd3e9334ef27c5f51f480bbf Mon Sep 17 00:00:00 2001 From: nanoseb Date: Tue, 19 Apr 2016 19:09:53 +0100 Subject: [PATCH] add psutil as dependency, bump v0.9.6 #7 added the need for psutil, it seems that it is not installed by default on many systems --- README.md | 5 +++-- nctelegram | 8 +++----- setup.py | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index d2b649f..6b5c28c 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,7 @@ A ncurses Telegram client developed in Python with the urwid library. * [Telegram-cli](https://github.com/vysheng/tg) * [urwid](http://urwid.org) * [pytg](https://github.com/luckydonald/pytg) +* python-psutil * libnotify (optional) * caca-utils (optional) @@ -33,7 +34,7 @@ $ pacaur -y nctelegram-git Install dependencies: ``` -$ sudo dnf install telegram-cli python-urwid +$ sudo dnf install telegram-cli python3-urwid python3-psutil ``` Install ncTelegram through pip: @@ -54,7 +55,7 @@ To install telegram-cli just follow its [readme](https://github.com/vysheng/tg). Install urwid: ``` -$ sudo apt-get install python3-urwid +$ sudo apt-get install python3-urwid python3-psutil ``` Install ncTelegram through pip: diff --git a/nctelegram b/nctelegram index 1ae6898..1762968 100755 --- a/nctelegram +++ b/nctelegram @@ -2,18 +2,16 @@ import os import sys import subprocess +import psutil import os.path import configparser import ncTelegram -import psutil -# Check if telegram-cli is already running on the same port -list_connection = [ i[4] for i in psutil.net_connections() ] -for connection in list_connection: - if connection and connection[1] == 4458: +for connection in psutil.net_connections(): + if connection[4] and connection[4][1] == 4458: print('telegram-cli is already running, kill it before starting ncTelegram') sys.exit(1) diff --git a/setup.py b/setup.py index 6c2f6f8..303693f 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup(name='ncTelegram', - version='0.9.5', + version='0.9.6', description='A curse Telegram client', license='GPLv3', author='Sébastien Lemaire',