You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Migrate to Sphinx autodoc.
Existing API docs were moved into docstrings, and Sphinx's autodoc
extension is used to generate the API reference automatically.
* Move close implementations to _close_impl.
Without this, autodoc was adding the close method to all the
subclasses of MSSBase that implemented it. It didn't add things like
grab and such, since the subclasses didn't implement it.
While I'm at it, also make the close method safe to call multiple
times.
* Fix bugs in previous autodoc commits.
First, we previously patched ctypes.WINFUNCTYPE in any time
mss.windows was imported, so that autodoc could import mss.windows.
Instead, move that to just when we're running Sphinx.
Second, when I added _close_impl, I accidentally deleted the super()
call in xshmgetimage. This mean that it never closes connections, and
exhausts the server's client limit.
Finally, in a previous commit, I tested changing mss.lock from a Lock
to an RLock while I was dealing with the fact that MSSBase.close holds
the lock, and the xlib implementation grabs the global lock. That was
not a great solution, so I backed that out. Instead, the xlib
implementation just trusts that it's run under the lock.
However, a better implementation might be to create a per-object lock
in MSSBase to protect _closing, instead of using the course-grained
global lock.
* Typo fix
Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
* Additional doc clarifications and formatting improvements
This adds extra detail to some docstrings, and brings formatting
in line with Sphinx conventions.
* Clean up the way constructor parameters are handled.
Most constructor parameters weren't being documented by autodoc, since
__init__ wasn't documented. If we added the __init__ docstrings to
the class documentation (autoclass_source="both"), then that puts an
awkward "Initialize a ScreenShot object" or similar sentence in the
class constructor documentation in the rendered output. Instead, we
put the __init__ parameter docs in the class docstring, and removed
__init__ docstrings.
Added "See also" sections to make looking up constructor parameters
across __init__(**kwargs) chains a little more obvious.
Added other requested changes:
* Added mss.darwin.IMAGE_OPTIONS to the docs
* Added docstring for mss.darwin.MSS.max_displays instance variable
* Added docstrings to NamedTuple classes in mss.models
* Added formatting for code samples in ScreenShot.bgra and rgb
* Typo fix
---------
Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
0 commit comments