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

Add API for popup GUI doc - docrepr.webview(obj) #8

Closed
wants to merge 7 commits into from

Conversation

techtonik
Copy link
Contributor

image

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.

@techtonik
Copy link
Contributor Author

@ccordoba12 ping?

@@ -16,6 +16,8 @@
Derived from spyderlib.utils.inspector and IPython.core.oinspect
"""

__version__ = '0.0.1'
Copy link
Member

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 :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@ccordoba12
Copy link
Member

Sorry, I totally forgot about this one. I already did a review of your work :-)

@ccordoba12
Copy link
Member

Thanks for the contribution, by the way :-)


Requires PyQt4 or PySide. Original code by
anatoly techtonik <[email protected]> is placed in
public domain.
Copy link
Member

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:

  1. docrepr authors are also all Spyder authors (because this code is derived from it) and you're already one of them.
  2. You have to accept the license of the project to contribute to it.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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
@techtonik
Copy link
Contributor Author

@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)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done with numpy.sin

@ccordoba12
Copy link
Member

@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 :-)

@ccordoba12 ccordoba12 closed this Mar 7, 2016
@techtonik
Copy link
Contributor Author

At the end, the purpose of docrepr is to generate web pages for docstrings

Or view them?

@ccordoba12
Copy link
Member

But that's for projects that use docrepr as a library to decide how they want to show the generated output, not for the library itself.

@techtonik
Copy link
Contributor Author

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?

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.

2 participants