GitXplorerGitXplorer
d

systa

public
8 stars
0 forks
14 issues

Commits

List of commits on branch main.
Verified
ba73638ca2f41e915f828d8732eec3c59cfa3fcf

Update formatting for interactive sessions in doc

ddmwyatt committed 8 months ago
Unverified
9478489a58e296594566f4ec639df6b3f7c88edc

Add references to fnmatch docs

ddmwyatt committed 3 years ago
Unverified
81fe62beecb5d843587a5084ae166e46682d017c

Add localmake.bat to build a local version of docs

ddmwyatt committed 3 years ago
Unverified
7691a32f426db2544a9a19ee014bc5e1e1c36bd7

Remove unnecessary print

ddmwyatt committed 3 years ago
Unverified
408a93a0ea0bd01dbc3328d2929e61abc7376259

Catch error when parsing latest version

ddmwyatt committed 3 years ago
Unverified
accc402778f66f57fa5d9f912fe21d4ca85a6a3d

Add changelog link to docs

ddmwyatt committed 3 years ago

README

The README file for this repository.

Systa: A Window for windows <https://en.wikipedia.org/wiki/Window_(computing)>_ on Windows™ <https://en.wikipedia.org/wiki/Microsoft_Windows>_.

Systa is a Microsoft Windows automation library, built for people who aren't Microsoft Windows programming gurus.

Documentation. <https://dmwyatt.github.io/systa/>_

Install

pip install systa

Basic Usage

.. code-block:: python

>>> from systa.windows import current_windows
>>> "Untitled - Notepad" in current_windows
True
>>> "🍔" in current_windows
False
>>> notepad = current_windows["Untitled - Notepad"][0]
>>> notepad.maximized
False
>>> notepad.maximized = True # it's now maximized
>>> notepad.maximized
True

Events

The real power of systa springs from its integration with Windows system hooks. You can run code when things happen on the system.

.. code-block:: python

from systa.events.decorators import listen_to, filter_by from systa.events.store import callback_store from systa.events.types import EventData

@filter_by.require_size_is_less_than(200, 200) @filter_by.require_title("*Notepad") @listen_to.restore @listen_to.create def a_func_to_do_the_thing(event_data: EventData): print(f"Notepad restored or created! ({event_data.window.width}, {event_data.window.height})")

callback_store.run()

The above code prints a message when:

  1. A window is opened OR a window is restored from a minimized state.
  2. AND the window's title ends with the string Notepad.
  3. AND the window's size is less than 200x200.