Skip to content

Commit

Permalink
give CREDITS to @aristocratos for new sponsorship (thank you ;))
Browse files Browse the repository at this point in the history
Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
  • Loading branch information
giampaolo committed Dec 28, 2020
1 parent cb66669 commit 8687a11
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ I: 557
Donations
-------------------------------------------------------------------------------

N: aristocratos
W: https://github.com/aristocratos

N: Daniel Widdis
C: Washington, USA
W: https://github.com/dbwiddis
Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,12 @@ Supporters
.. raw:: html

<div>
<a href="https://github.com/dbwiddis"><img height="40" width="40" src="https://avatars1.githubusercontent.com/u/9291703?s=88&amp;u=3a4cbf1ea36068a36392856adb2fb02f623a3235&amp;v=4" /></a>
<a href="https://github.com/dbwiddis"><img height="40" width="40" title="Daniel Widdis" src="https://avatars1.githubusercontent.com/u/9291703?s=88&amp;v=4" /></a>
<a href="https://github.com/aristocratos"><img height="40" width="40" title="aristocratos" src="https://avatars3.githubusercontent.com/u/59659483?s=96&amp;v=4" /></a>
</div>
<sup><a href="https://github.com/sponsors/giampaolo">add your avatar</a></sup>


Contributing
============

Expand Down
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ Supporters
.. raw:: html

<div>
<a href="https://github.com/dbwiddis"><img height="40" width="40" src="https://avatars1.githubusercontent.com/u/9291703?s=88&amp;u=3a4cbf1ea36068a36392856adb2fb02f623a3235&amp;v=4" /></a>
<a href="https://github.com/dbwiddis"><img height="40" width="40" title="Daniel Widdis" src="https://avatars1.githubusercontent.com/u/9291703?s=88&amp;v=4" /></a>
<a href="https://github.com/aristocratos"><img height="40" width="40" title="aristocratos" src="https://avatars3.githubusercontent.com/u/59659483?s=96&amp;v=4" /></a>
</div>
<br />
<sup><a href="https://github.com/sponsors/giampaolo">add your avatar</a></sup>
Expand Down

7 comments on commit 8687a11

@aristocratos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giampaolo
Well I am relying pretty heavily on psutil for https://github.com/aristocratos/bpytop so seems like a good idea to pay forward some of the sponsorship I get to you :)

@giampaolo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice tool you got there. Had no idea curses lib (I guess it's curses?) could be pushed so far in terms of GUI programming. Thanks again.

@giampaolo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aristocratos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giampaolo
Thanks :)

I guess it's curses?

I wrote it from scratch since I ported it from my previous project https://github.com/aristocratos/bashtop (written in bash), so It's basically alot of escape codes and a couple small functions for colouring and buffering text i/o.

@giampaolo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aristocratos

written in bash
https://github.com/aristocratos/bashtop/blob/master/bashtop
It's basically escape codes [...] for colouring and buffering text i/o.

Unbelievable!

@giampaolo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aristocratos compare my wrapper around escape codes LOL

psutil/psutil/_common.py

Lines 781 to 797 in 40abe5c

def hilite(s, color=None, bold=False): # pragma: no cover
"""Return an highlighted version of 'string'."""
if not term_supports_colors():
return s
attr = []
colors = dict(green='32', red='91', brown='33', yellow='93', blue='34',
violet='35', lightblue='36', grey='37', darkgrey='30')
colors[None] = '29'
try:
color = colors[color]
except KeyError:
raise ValueError("invalid color %r; choose between %s" % (
list(colors.keys())))
attr.append(color)
if bold:
attr.append('1')
return '\x1b[%sm%s\x1b[0m' % (';'.join(attr), s)

@aristocratos
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@giampaolo

Unbelievable!

Yeah, bashtop snowballed a bit out of proportion, was just supposed to be a mockup of the ui for a gtop clone :P

compare my wrapper around escape codes LOL

Well, would be a bit overkill with 24-bit color and gradients for highlithing :)

Please sign in to comment.