-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add API for popup GUI doc - docrepr.webview(obj) #8
Conversation
@ccordoba12 ping? |
@@ -16,6 +16,8 @@ | |||
Derived from spyderlib.utils.inspector and IPython.core.oinspect | |||
""" | |||
|
|||
__version__ = '0.0.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change version to 0.1
. 0.0.1
is too small :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Sorry, I totally forgot about this one. I already did a review of your work :-) |
Thanks for the contribution, by the way :-) |
|
||
Requires PyQt4 or PySide. Original code by | ||
anatoly techtonik <[email protected]> is placed in | ||
public domain. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove your name and different license from here. My reasons:
docrepr
authors are also all Spyder authors (because this code is derived from it) and you're already one of them.- You have to accept the license of the project to contribute to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not a difference license, but a note that original code submitted by me is placed into public domain and doesn't bear additional restrictions of Spyder license in case somebody will need to reuse it in their own project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is not a script, nor something that can be used independently of the project. It's just an additional module. So please remove your name and the public domain notice out of it. The AUTHORS
file already mention those who have worked in the project.
This has been the work of several people, who helped to fix bugs and improve things in the code inherited from Spyder. That's why in AUTHORS
appears the whole Spyder Development Team as author.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is code that could be copy/pasted into different project that need a webview for their HTML stuff without reference to Spyder, and me is one of those people person. You may remove the note yourself, but I submit it as a public domain contribution. And you can remove the note, because it is public domain, but I don't want to do this myself for the reason stated - if I need the code later, I will copy/paste the code from my commit that is clearly marked as PD.
It is a common practice to take public domain code and modify it.
https://github.com/python/cpython/blob/1fe0fd9feb6a4472a9a1b186502eb9c0b2366326/Modules/_ctypes/libffi/install-sh
https://github.com/python/cpython/blob/c1e0265342dbfc710ecdd4be6fab707f7bd74dce/Lib/doctest.py
So I don't get what are you objecting of. It is not about me trying to get more credit than other people - it is just about making clear about origin of the public domain code, so people can get formal proof for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what's the code that exactly can be copy/pasted? I'd say the only important code is the one in show_window
. The rest can't be really copy/pasted.
So then, please add a docstring and your name to that function only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You copy/paste the whole working example and then strip all the meat and dependencies. But as I said - it is submitted into public domain, so after you merge it, you can strip all these "copyright" notes without any legal problems. I am okay with that.
- made Qt an optional dependency for docrepr - README wording - version field changed from 0.0.1 to 0.1 spyder-ide#8
@ccordoba12 please take a look. |
`oname` is a just a name for the object, because Python loses it when | ||
variable is passed to function. | ||
|
||
![webview example](example.png) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use as an example screenshot something meaningful, such as the docrepr output of numpy.sin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, numpy
is not available for my platform - numpy/numpy#5479 There are some unofficial binaries though, so I need some time to test them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no problem. Then please just use range
as an object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with numpy.sin
@techtonik, I think I'm going to decline your contribution, not because of our copyright and ownership discussions but because I don't want to add a dependency on Qt for this package (even if optional). At the end, the purpose of docrepr is to generate web pages for docstrings :-) |
Or view them? |
But that's for projects that use |
Okay. Now that docrepr is on PyPI, it doesn't matter. BTW, the generator is extremely slow - is it possible to generate contents into memory? |
I reduced the window size manually. The perfect size and position needs to be calculated. For now it is default size and position, which is anchored at bottom middle and is too large to my liking.