Skip to content

Commit

Permalink
Got a first version of the API doc generated.
Browse files Browse the repository at this point in the history
  • Loading branch information
blep committed Aug 29, 2023
1 parent 1aed6c7 commit 69856cd
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 9 deletions.
7 changes: 7 additions & 0 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
API of win32_window_monitor
===========================

.. automodule:: win32_window_monitor
:members:
:undoc-members:
:show-inheritance:
12 changes: 11 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import sphinx_rtd_theme
import os
import sys
sys.path.insert(0, os.path.abspath('..'))

# Configuration file for the Sphinx documentation builder.
#
Expand All @@ -21,8 +24,15 @@
"myst_parser",
]

# TODO check the napoleon extension which allow more compact/readable docstring:
# https://sphinxcontrib-napoleon.readthedocs.io/en/latest/


templates_path = ['_templates']
exclude_patterns = []
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']

# ensure that __all__ is not ignored
autosummary_imported_members = True

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
Expand Down
7 changes: 1 addition & 6 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ example is not generated when restoring a minimized window.
:maxdepth: 2
:caption: Contents:

.. automodule:: win32_window_monitor
:members:

.. autosummary::
:toctree: generated

api

.. include ../README.md
Expand Down
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=.
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
20 changes: 19 additions & 1 deletion win32_window_monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,22 @@
run_message_loop,
post_quit_message,
post_quit_message_on_break_signal,
)
)

__all__ = [
# ids
'HookEvent',
'ObjectId',
# win32api
'WinEventProcType',
'HWINEVENTHOOK',
'get_process_filename',
'get_hwnd_process_id',
'get_window_title',
'set_win_event_hook',
'unhook_win_event',
'init_com',
'run_message_loop',
'post_quit_message',
'post_quit_message_on_break_signal',
]
1 change: 0 additions & 1 deletion win32_window_monitor/win32api.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ def init_com():
def run_message_loop():
"""
Runs WIN32 message loop (user32.GetMessageW) until WM_QUIT is received.
:return:
"""
msg = ctypes.wintypes.MSG()
while user32.GetMessageW(ctypes.byref(msg), 0, 0, 0) != 0:
Expand Down

0 comments on commit 69856cd

Please sign in to comment.