darxtrix / ptop Goto Github PK
View Code? Open in Web Editor NEWAn awesome task manager written in python. :computer:
Home Page: http://darxtrix.in/ptop/
License: MIT License
An awesome task manager written in python. :computer:
Home Page: http://darxtrix.in/ptop/
License: MIT License
I don't have python2 installed so calling python
in my terminal returns command not found
. To start python, I need to call python3
. I needed to change
update_success_status |= os.system('cd /tmp/{0}/ && sudo python setup.py install'.format(source_folder))
to this:
update_success_status |= os.system('cd /tmp/{0}/ && sudo python3 setup.py install'.format(source_folder))
to get the program to update correctly. (these edits are on main.py)
Possible solution:
use sys.version
to get the version of python that is currently running and use the proper command
Restart of processes like browsers, text editors,... not available as mentioned a priority in issue #29
Commandline configuration options to set different themes that are supported by npyscreen
Ptop asks me to update every time I run it.
samy-mbp-5:~ samybencherif$ ptop
A new version is available, would you like to update (Y/N) ? Y
Creating a temporary directory /tmp/FVZWD0INN0 ...
Cloning into '/tmp/FVZWD0INN0'...
remote: Enumerating objects: 88, done.
remote: Counting objects: 100% (88/88), done.
remote: Compressing objects: 100% (59/59), done.
remote: Total 784 (delta 43), reused 65 (delta 26), pack-reused 696
Receiving objects: 100% (784/784), 9.35 MiB | 1.16 MiB/s, done.
Resolving deltas: 100% (374/374), done.
Installing ptop ...
[ ... ]
Using /Library/Python/2.7/site-packages
Finished processing dependencies for ptop==1.1
samy-mbp-5:~ samybencherif$ ptop
A new version is available, would you like to update (Y/N) ?
However after running the update, I am in fact not updated.
samy-mbp-5:~ samybencherif$ ptop -v
ptop 1.0
For anyone else experiencing this issue it can be temporarily patched by disabling the updater altogether.
curl -L https://bit.ly/2KBDt9y | python3 -
^ run at your own discretion
All of the positions, lengths, widths are hardcoded. Need to separate them in a different config file or in the same file.
Take into account the situations in which the Terminal screen is quite small. The following strategy can be used.
The keyboard shortcuts should be separated in some config file because the current ones' may interfere with the user bindings. Also, in this case we also need to handle the rendering of the shortcuts from the config file.
Currently the sensors have update interval hardcoded. This is required to be abstracted out such that the users can set them according to their own requirement.
Display the current percentage in the widget name and relate the height with the percentage. Dynamically check the height and then according to percentage draw the height.
Log the logs to file, such as exceptions etc.
Showing long running processes in the process table is of no use to the user coz user will be less probable to check their stats, better would be to make the default list of process to be sorted by up time of processes.
Hi,
I am trying to install ptop on CentOS 7 without success.
The error I am getting is:
psutil/_psutil_common.c:9:20: fatal error: Python.h: No such file or directory
#include <Python.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1----------------------------------------
Command "/usr/bin/python2 -u -c "import setuptools, tokenize;file='/tmp/pip-install-aKSv9b/psutil/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-record-XEO958/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-aKSv9b/psutil/
I understand that it says I need Python.h but there is no one. With what should it be comming?
EDIT: I have tried with yum install python34-devel but I get the same error.
Handy for systems not having pip installed.
Similarly should we also have a apt-get entry ?
as far as i can tell with urwid as ui library it should be possible to show the same ui without the glitches
$ ptop -t 232323
Traceback (most recent call last):
File "/usr/bin/ptop", line 9, in <module>
load_entry_point('ptop==0.0.6', 'console_scripts', 'ptop')()
File "/usr/lib/python2.7/site-packages/ptop/main.py", line 48, in main
app.run()
File "/usr/lib/python2.7/site-packages/npyscreen/apNPSApplication.py", line 30, in run
return npyssafewrapper.wrapper(self.__remove_argument_call_main)
File "/usr/lib/python2.7/site-packages/npyscreen/npyssafewrapper.py", line 41, in wrapper
wrapper_no_fork(call_function)
File "/usr/lib/python2.7/site-packages/npyscreen/npyssafewrapper.py", line 97, in wrapper_no_fork
return_code = call_function(_SCREEN)
File "/usr/lib/python2.7/site-packages/npyscreen/apNPSApplication.py", line 25, in __remove_argument_call_main
return self.main()
File "/usr/lib/python2.7/site-packages/ptop/interfaces/GUI.py", line 239, in main
npyscreen.setTheme(self.get_theme())
File "/usr/lib/python2.7/site-packages/ptop/interfaces/GUI.py", line 118, in get_theme
return self.themes[self.arg]
KeyError: '232323'
Ctrl+c doesn't work, nothing does, you need to restart the terminal entirely.
Killing process (ctrl+K) when ptop starts causes error.
See if there is any scope of optimizing the sorting behavior.
Use percentage to scale the contents
if I quickly want to check consumption it doesn't seem fun to have to type out -t ...
each time, so either select a default theme globally, or set a way for a user to define their choice them for subsequent runs would be great so can just initialize with ptop
Add the following features:
Show ports information for a particular process
Search by ports will also be there as the current search searches in the whole process line.
Kill and restart option
Ptop does not work with python 3
[x] Bug (Typo)
reponsive
, however expect to see responsive
.privelages
, however expect to see privileges
.overriden
, however expect to see overridden
.overrided
, however expect to see overridden
.enteries
, however expect to see entries
.compaible
, however expect to see compatible
.chossing
, however expect to see choosing
.beacuse
, however expect to see because
.adminstrator
, however expect to see administrator
.Semi-automated issue generated by
https://github.com/timgates42/meticulous/blob/master/docs/NOTE.md
To avoid wasting CI processing resources a branch with the fix has been
prepared but a pull request has not yet been created. A pull request fixing
the issue can be prepared from the link below, feel free to create it or
request @timgates42 create the PR. Alternatively if the fix is undesired please
close the issue with a small comment about the reasoning.
https://github.com/timgates42/ptop/pull/new/bugfix_typos
Thanks.
I installed ptop in ubuntu successfully through pip. However when you try to launch ptop it can't find it because the terminal / system believes you're trying to launch a program called ptop in the repositories and suggests installing it with apt-get... it's an entirely different program
so how can i run ptop? is there a direct command i can use?
Two things we can add:
l
ptop prompts for search box but it gets overridden in the current behavior, this should me made functional for process sortingOne more observation, pressing l
makes q
useless ..^ + q can be used I guess.
This will help in implementing the search functionality https://github.com/npcole/npyscreen/blob/d286599d63de599a7df1e6e75367d1928a1b0ccf/npyscreen/wgmultiline.py
When the search action is fired there should be a way to keep the search pop up attached to the display in case the update
function is fired through the thread job in background
Just thinking
Do I really need a thread job here for updating the UI ? I know while_waiting
is getting called anyway from the logs why do i need a thread job then
in /usr/lib/python3.4/threading.py line 920
TypeError: non-empty format string passed to object.format
ptop 0.0.6 Python 3.4.3 on Arch linux.
Add incoming and outgoing bandwidth to ptop
I am not able to see the logs in the .ptop.log
file.
A better way would be make a directory named .ptop
and add separate log files under it. For the sake of preventing memory flooding, we have to have some cycling/cleaning mechanism of log files.
Need to see what are the best practices for usage of logging module.
Observations
I'm running ptop on a:
2011 Macbook Pro 16GB RAM
running in Mac terminal.app
vagrant ssh
Minimised the issue by customising the CPU refresh time to 2000 with -csrt 2000
Great job with it so far, though.
Just booted a docker container and installed ptop in it, can't see cpu and memory charts.
Observation 1:
In case any exception occurs, an exception should be logged properly and ptop should be killed properly will all of the threads ( gui and sensor threads ) killed properly. For eg. in case, the GUI cannot be drawn properly exception occurs and ptop hangs.
Observation 2:
While killing ptop, catch the kill signals properly and kill all the threads.
I got this error after I called ptop
PS C:\\> ptop
Traceback (most recent call last):
File "C:\Python39\Scripts\ptop-script.py", line 33, in <module>
sys.exit(load_entry_point('ptop==1.1', 'console_scripts', 'ptop')())
File "C:\Python39\Scripts\ptop-script.py", line 25, in importlib_load_entry_point
return next(matches).load()
File "C:\Python39\lib\importlib\metadata.py", line 77, in load
module = import_module(match.group('module'))
File "C:\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 790, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "C:\Python39\lib\site-packages\ptop-1.1-py3.9.egg\ptop\main.py", line 13, in <module>
from ptop.interfaces import PtopGUI
File "C:\Python39\lib\site-packages\ptop-1.1-py3.9.egg\ptop\interfaces\__init__.py", line 1, in <module>
from .GUI import PtopGUI
File "C:\Python39\lib\site-packages\ptop-1.1-py3.9.egg\ptop\interfaces\GUI.py", line 6, in <module>
import npyscreen, math, drawille
File "<frozen zipimport>", line 259, in load_module
File "C:\Python39\lib\site-packages\npyscreen-4.10.5-py3.9.egg\npyscreen\__init__.py", line 5, in <module>
File "<frozen zipimport>", line 259, in load_module
File "C:\Python39\lib\site-packages\npyscreen-4.10.5-py3.9.egg\npyscreen\wgwidget.py", line 5, in <module>
File "C:\Python39\lib\curses\__init__.py", line 13, in <module>
from _curses import *
ModuleNotFoundError: No module named '_curses'
windows 10
python 3
so whats worng?
ptop closes, but terminal is useless and needs to be restarted.
Just like this: https://github.com/anishathalye/lumen/blob/f9779a3f3aa454a0c39e75e908b0cc843a9800ed/Lumen/stats.m
And log any exception if any, just keep in mind not to log any PI or sensitive data.
Listen for CMD +
& CMD -
and resize the app (stop the old app and redraw the form again). One more thing can be checked is horizontal vs vertical scaling. How it can fit in ?
Case 1 - Font resizing
Font changing in terminal(before & after rendering)
Scrolling can be an option ?
Tested with drawille, yes the terminal size changes with CMD+ and CMD- not only the font size is increased.
Case 2 - Terminal window resizing
This can be handled easily by checking change in terminal window sizing and then redrawing the GUI.
Solution => Keep listening for the size of the terminal and re-draw.
This will be also helpful
https://groups.google.com/forum/#!msg/npyscreen/anab-NQC_IY/8J4HeQJ-XCQJ;context-place=forum/npyscreen & resizing logic at http://npyscreen.readthedocs.io/form-objects.html
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.