Code Monkey home page Code Monkey logo

huepy's Introduction

Hi, I'm Somdev

I am a cyber security researcher and programmer.

Do you want to be one too? Check out my advice for learning hacking and programming.

You can support my work with a few bucks, here.

Twitter Follow

huepy's People

Contributors

anthonysea avatar aussedatlo avatar campbellowen avatar detonavomek avatar mingrammer avatar pkeeper avatar s0md3v avatar thanosgn avatar wrongpaul avatar yochem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

huepy's Issues

Syntax error on clean install

Clean install via pip, imports just fine, but none of the options work, all produce the same error.

example:

~ python
Python 3.7.2 (default, Jan 10 2019, 23:51:51) 
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from huepy import *
>>> print red('This string is red')
  File "<stdin>", line 1
    print red('This string is red')
            ^
SyntaxError: invalid syntax
>>> print ("regular print test")
regular print test
>>> 

embedded colored strings unset outer colored string

The first thing i tried was putting a colored string inside another colored string to see if they play nice with each other, and they didn't 😢

image

  • Python 3.6.5
  • huepy 0.9.8.1
  • ipython 6.3.1 on yakuake 3.0.5 (Antergos)

This exact problem is also an issue with kennethreitz/crayons. This the issue [0] (i copied issue title) and this is the solution [1] *

0: https://github.com/kennethreitz/crayons/issues/9
1: https://github.com/kennethreitz/crayons/pull/13

  • PR has no answer from maintainer of the package. Apparently he doesn't like his child anymore. Shame on him.

Windows support

Windows users can use colorama to convert from ansi.

import huepy
import colorama
colorama.init()

image

Not sure how to get the colors bright though. Not sure if that has to be done in colorama or hue.

Port hue to Python3

First of all, thank you for this package. It works great.

Because Python stops supporting Python2.7 on January 1, 2020, it seems logical to port hue to Python3. Do you want me to do this and create a PR? It doesn't seems like it's much work, but happy to help.

Have a nice day,
@yochem

huepy 1.1 fails pip installation

When attempting to install huepy v1.1 using pip, I see the following error:

Installing collected packages: huepy
    Running setup.py install for huepy ... error
    ERROR: Command errored out with exit status 1:
     command: /home/pi/.pyenv/versions/3.7.5/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ohrb0trx/huepy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ohrb0trx/huepy/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-ng40dn_2/install-record.txt --single-version-externally-managed --compile
         cwd: /tmp/pip-install-ohrb0trx/huepy/
    Complete output (28 lines):
    running install
    running build
    running build_py
    file huepy.py (for module huepy) not found
    creating build
    creating build/lib
    creating build/lib/huepy
    copying huepy/huepy.py -> build/lib/huepy
    copying huepy/test.py -> build/lib/huepy
    copying huepy/__init__.py -> build/lib/huepy
    running egg_info
    writing huepy.egg-info/PKG-INFO
    writing dependency_links to huepy.egg-info/dependency_links.txt
    writing top-level names to huepy.egg-info/top_level.txt
    file huepy.py (for module huepy) not found
    reading manifest file 'huepy.egg-info/SOURCES.txt'
    writing manifest file 'huepy.egg-info/SOURCES.txt'
    file huepy.py (for module huepy) not found
    running install_lib
    creating /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy
    copying build/lib/huepy/huepy.py -> /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy
    copying build/lib/huepy/test.py -> /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy
    copying build/lib/huepy/__init__.py -> /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy
    byte-compiling /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy/huepy.py to huepy.cpython-37.pyc
    byte-compiling /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy/test.py to test.cpython-37.pyc
    byte-compiling /home/pi/.pyenv/versions/3.7.5/lib/python3.7/site-packages/huepy/__init__.py to __init__.cpython-37.pyc
    running install_data
    error: can't copy 'LICENSE': doesn't exist or not a regular file

huepy 1.0 installs fine. This is using Python 3.7.

duplicate functions

hello there, this is amazing! I was looking for something like this.

There is a problem with the functions, the black and lightred are duplicated. Both lightred are the same, you just have to delete one, but the two black functions have different values.

I hope this helps.

Python2 crashes with non-ascii characters.

Hi,

When using huepy with python2 I face a problem when the string to be printed includes non-ascii characters.
Python3 works fine though.

Here is a minimal working example that demonstrates this behavior.

# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
from huepy import *

def main():
    pizza = 'John’s Pizza'
    print('Pizza: |' + green(pizza) + '|' )

if __name__ == '__main__':
    main()

Python3 execution:

❯ python3 huepy_unicode_test.py
Pizza: |John’s Pizza|

Python2 execution:

❯ python2 huepy_unicode_test.py 
Traceback (most recent call last):
  File "huepy_unicode_test.py", line 10, in <module>
    main()
  File "huepy_unicode_test.py", line 7, in main
    print('Pizza: |' + green(pizza) + '|' )
  File "/usr/local/lib/python2.7/dist-packages/huepy/__init__.py", line 53, in <lambda>
    locals()[key] = lambda s, prefix=prefix, key=value: _gen(s, prefix, key)
  File "/usr/local/lib/python2.7/dist-packages/huepy/__init__.py", line 47, in _gen
    return '\033[{}m{}\033[0m{}'.format(key, colored, not_colored)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 4: ordinal not in range(128)

Ability to add new labels, colors, styles

Came across this today, looks great!

I think it could be helpful if there was a way for users to add their own labels, colors, and styles in addition to the preset values.

Hue vs Huepy

The readme is kind of inconsistent:

the last bit of code in it is

from hue import *

which yields an error for me in Python 3.6

the above mentioned

from huepy import *

works. The difference between the both should be explained somewhere

three dots

It is very simple, which is a strength. I would suggest only to add ... to info,que etc to have more like logger output

[+]... text

run() has no contrast on light theme

During the day my terminal is in the tomorrow-light theme. This results in print(run(...)) not really rendering the prefix because it uses the same white color as the background. Can run be changed to either use the foreground/text color (most people probably use something similar to a white on black or black on white terminal) or the grey color?

Light colors and styles not doing anything

Hi, this is awesome but i'm having some issues with light colors and styles, it's like they don't do anything at all. (Under and itallic work correctly)
I use python 3.7 in Windows 10

also, when I write anything from huepy it says: 'red' may be undefined, or defined from star
imports: huepy
but still works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.