Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

curses example #49

Merged
merged 3 commits into from
May 3, 2020
Merged

curses example #49

merged 3 commits into from
May 3, 2020

Conversation

DaWe35
Copy link
Contributor

@DaWe35 DaWe35 commented Apr 30, 2020

Description

Discussed in #48

How Has This Been Tested

Tested on Win 10

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the
    CONTRIBUTING
    document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@oliver-zehentleitner
Copy link
Member

I downloaded the example from your branch and get this error:

oliver@valkyrie ~/pyCharmProjects/unicorn-binance-websocket-api $ ./example_curses.py 
Traceback (most recent call last):
  File "./example_curses.py", line 121, in <module>
    wrapper(main)
  File "/opt/anaconda/anaconda/lib/python3.7/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "./example_curses.py", line 117, in main
    display.addstr(0, 0, summary)
_curses.error: addwstr() returned ERR

i run it in bash on linux mint.
Are you able to run it on linux?

@DaWe35
Copy link
Contributor Author

DaWe35 commented Apr 30, 2020

I downloaded the example from your branch and get this error:

oliver@valkyrie ~/pyCharmProjects/unicorn-binance-websocket-api $ ./example_curses.py 
Traceback (most recent call last):
  File "./example_curses.py", line 121, in <module>
    wrapper(main)
  File "/opt/anaconda/anaconda/lib/python3.7/curses/__init__.py", line 94, in wrapper
    return func(stdscr, *args, **kwds)
  File "./example_curses.py", line 117, in main
    display.addstr(0, 0, summary)
_curses.error: addwstr() returned ERR

i run it in bash on linux mint.
Are you able to run it on linux?

I think you get this error when the window size is too small. Can you retry in maximized window? I really don't know how to solve it...
https://stackoverflow.com/questions/54409924/curses-error-addwstr-returned-err-on-changing-nlines-to-1-on-newwin-method

@DaWe35
Copy link
Contributor Author

DaWe35 commented Apr 30, 2020

Ok I have an idea

@DaWe35
Copy link
Contributor Author

DaWe35 commented Apr 30, 2020

Okay, now it works on small window

@DaWe35
Copy link
Contributor Author

DaWe35 commented May 1, 2020

I found another problem (besides the colors), curses just cut the last character of every line.

kép

@DaWe35
Copy link
Contributor Author

DaWe35 commented May 1, 2020

Okay, I'm getting a black screen with Ubuntu/Putty

@oliver-zehentleitner
Copy link
Member

oliver-zehentleitner commented May 1, 2020

I have to read about curses, atm i have no knowledge about it. (https://docs.python.org/3/howto/curses.html)

  1. If last char gets removed, we can add one extra char at the end of every line that can get removed and will not be missed. But maybe there is a more elegant solution like a parameter (need reading the docs)
  2. I would try to make a new method like curses_summary() that can be used instead of print_summary()
  3. It must be stable without errors on windows and unix.

I dont know, do you want to do this together or do you like to try it your self?

@oliver-zehentleitner
Copy link
Member

One more suggestion, can you create an example_curses.py file? If it works fine, we can update other example files.

@DaWe35
Copy link
Contributor Author

DaWe35 commented May 2, 2020

Okay, it needs more testing & doc reading, we found more bugs than I expected. I have to postpone the task until later, cause I have a lot of urgent work now.

@oliver-zehentleitner
Copy link
Member

No worries! Lets make it uncomplicated, work on it as you like it and when its ready we merge it.

I am happy about your contributions! THANKS!

@oliver-zehentleitner oliver-zehentleitner added this to In progress in Todo May 2, 2020
@oliver-zehentleitner oliver-zehentleitner merged commit be46245 into LUCIT-Systems-and-Development:master May 3, 2020
@oliver-zehentleitner oliver-zehentleitner moved this from In progress to To do in Todo May 3, 2020
@oliver-zehentleitner oliver-zehentleitner removed this from To do in Todo May 6, 2020
BestCryptoKnight pushed a commit to BestCryptoKnight/unicorn-binance-websocket-api that referenced this pull request Jul 10, 2022
BestCryptoKnight pushed a commit to BestCryptoKnight/unicorn-binance-websocket-api that referenced this pull request Jul 10, 2022
This reverts commit d8a913403c48aa2cb1c1d20de13195ff39e26829.

Revert "fix LUCIT-Systems-and-Development/unicorn-binance-websocket-api#49 (comment)"

This reverts commit e5cb4aaef441fff2b2ad9fa161f94bffc0c54959.

Revert "curses example"

This reverts commit aae6bf5f1797bf7085ba557d608867c343f59aa6.
Seven-112 pushed a commit to Seven-112/unicorn-binance-websocket-api that referenced this pull request May 16, 2023
Seven-112 pushed a commit to Seven-112/unicorn-binance-websocket-api that referenced this pull request May 16, 2023
This reverts commit d8a913403c48aa2cb1c1d20de13195ff39e26829.

Revert "fix LUCIT-Systems-and-Development/unicorn-binance-websocket-api#49 (comment)"

This reverts commit e5cb4aaef441fff2b2ad9fa161f94bffc0c54959.

Revert "curses example"

This reverts commit aae6bf5f1797bf7085ba557d608867c343f59aa6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants