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

Highlight lines of code #263

Open
district10 opened this issue Jan 5, 2021 · 8 comments
Open

Highlight lines of code #263

district10 opened this issue Jan 5, 2021 · 8 comments

Comments

@district10
Copy link

Currently, klaus supports hightlight one line, e.g.
http://klausdemo.lophus.org/~jonashaag/klaus/blob/master/setup.py#L-18

Could it be possible to support range selection like on Github:
https://github.com/jonashaag/klaus/blob/master/setup.py#L18-L27 (hold shift to select lines)

Thank you.

@jonashaag
Copy link
Owner

Yes, if anyone wants to work it that would be great!

@castellanprime
Copy link

Hi, I would like to work on this feature. Based on the request, I am trying to decide between two approaches:
(a) A new query string parameter (selections). This allows us to keep the previous single selection instead of overloading the single selection
(b) Overloading the single selection, with something like http://klausdemo.lophus.org/~jonashaag/klaus/blob/master/setup.py#L-18&L-27.

Are this approaches sufficient or is there an approach that would be preferable, in line with the structure of the project.

@jonashaag
Copy link
Owner

Nice! Can we make it like GitHub?

@castellanprime
Copy link

Oh. Okay. I will look into making it like Github. Thanks.

@castellanprime
Copy link

castellanprime commented Jan 15, 2021

I am sorry if this question sounds foolish. I wanted to ask how the testing in this project is normally done. I am trying to manually test, that is, view some kind of log of the variables but I am so far unable to do so. First,
(a) I tried using pdb but pdb never reaches the breakpoint I set in views.py.
(b) I tried to using python logging, but the logs are not showing up, Coming from Tornado, i would normally disable the tornado.access module to get the logs that I want, but I do not know module to disable for Flask.
My only recourse now is to write a "unit test" to test my changes.
Is my situation unique and if so, how do I go about resolving it? Thanks.

@jonashaag
Copy link
Owner

How do you start Klaus exactly? If you use the CLI the logs should show up in the terminal. Flask also has a very nice debugger. You can also start Klaus using another WSGI server if you want.

@castellanprime
Copy link

castellanprime commented Jan 16, 2021

I normally start it with the cli, like klaus [dir1] ... What i wanted to was to print not the request logs, the actual application logs. That is, if I put a print statement in the views.py, I want to see it in the consoie logs as well.

@jonashaag
Copy link
Owner

That should be exactly what’s happening by default. Are you sure your changes are even effective? Maybe the CLI loads the Klaus modules from some other path outside of the Git checkout? (eg installed with pip)

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

No branches or pull requests

3 participants