File tree Expand file tree Collapse file tree 15 files changed +197
-17
lines changed
Expand file tree Collapse file tree 15 files changed +197
-17
lines changed Original file line number Diff line number Diff line change 11# DSI (Display Server Interactions)
22
33DSI allows you to perform basic interactions on your display server, like screenshotting a window or sending input to it.
4- Currently DSI only supports X11/Xorg (GNU/Linux) but it aims to be cross-platform.
4+ Currently, DSI only supports X11/Xorg (GNU/Linux) but it aims to be cross-platform.
55
6- ## Usage
6+ ** WARNING: Please Do not use DSI in production, because it's currently in development! **
77
8- look at the [ documentation] ( "https://dsi.readthedocs.io/en/latest/ ) for moor help
8+ ## Quick overview
9+
10+ Look at the [ documentation] ( https://python-dsi.readthedocs.io/en/latest/ ) for moor information's
11+
12+ ### Get a window
913
1014``` python
1115from dsi import DSI
12-
1316window = DSI .get_active_window()
17+ ```
18+
19+ ### Get basic window information
1420
21+ ``` python
1522print (" Active window: " )
1623print (" \t Name: {} " .format(window.name))
1724print (" \t PID: {} " .format(window.pid))
1825```
26+
27+ ### Take a screenshot of the window
28+
29+ ``` python
30+ import cv2
31+ import numpy as np
32+
33+ img = np.array(window.get_image())
34+ cv2.imshow(f ' Screenshot of " { window.name} " ' , img)
35+
36+ while True :
37+ if cv2.waitKey(1 ) & 0x FF == ord (' q' ):
38+ break
39+ ```
40+
41+ ### Sending keys to a window
42+
43+ ``` python
44+ window.send_str(" Hello World" )
45+ ```
46+
47+ ### Sending mouse clicks
48+
49+ ``` python
50+ window.send_mouse_click(100 , 100 )
51+ ```
52+
53+ ### Move the mouse pointer
54+
55+ ``` python
56+ window.warp_pointer(x = 100 , y = 100 )
57+ ```
Original file line number Diff line number Diff line change 11# DSI Documentation
22
3- ## Installation/ Requirements
3+ [ DSI's Documentation] ( https://python-dsi.readthedocs.io/en/latest ) is made with [ Sphinx] ( https://www.sphinx-doc.org/en/master/index.html ) and it will be automatically uploaded to [ Read The Docs] ( https://readthedocs.org/ ) .
4+
5+ ## Installation / Requirements
46
57``` sh
68pip install -Ur requirements.txt
@@ -11,3 +13,7 @@ pip install -Ur requirements.txt
1113``` sh
1214make html
1315```
16+
17+ ## View the build
18+
19+ The view the build you just need to go to [ build/html] ( build/html ) and open the [ index.html] ( build/html/index.html ) with your web browser
Original file line number Diff line number Diff line change @@ -50,7 +50,10 @@ def get_version(rel_path: str) -> str:
5050# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
5151# ones.
5252extensions = [
53- "sphinx_copybutton"
53+ "sphinx_copybutton" ,
54+ "sphinx.ext.viewcode" ,
55+ "sphinx.ext.intersphinx" ,
56+ "sphinx.ext.autodoc"
5457]
5558
5659# Add any paths that contain templates here, relative to this directory.
@@ -77,3 +80,8 @@ def get_version(rel_path: str) -> str:
7780html_static_path = ['_static' ]
7881
7982intersphinx_mapping = {"python" : ("http://docs.python.org/3" , None )}
83+
84+ autodoc_default_options = {
85+ 'member-order' : 'bysource' ,
86+ 'undoc-members' : True ,
87+ }
Original file line number Diff line number Diff line change 1- ================
21Getting a Window
32================
43
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ Welcome to DSI's documentation!
55 :maxdepth: 2
66 :caption: Contents:
77
8- get_window
9- os_specific_code
8+ get_window.rst
9+ os_specific_code.rst
10+ reference.rst
1011
1112Indices and tables
1213==================
Original file line number Diff line number Diff line change 1- ================
21OS specific code
32================
43
Original file line number Diff line number Diff line change 1+ Reference
2+ =========
3+
4+ .. toctree ::
5+ :maxdepth: 3
6+
7+ reference/windowbase.rst
8+ reference/image.rst
9+ reference/base.rst
10+ reference/linux.rst
Original file line number Diff line number Diff line change 1+ dsi.base.DSIBase
2+ ================
3+
4+
5+ .. autoclass :: dsi.base.DSIBase
6+ :members:
Original file line number Diff line number Diff line change 1+ dsi.image.Image
2+ ===============
3+
4+
5+ .. autoclass :: dsi.image.Image
6+ :members:
Original file line number Diff line number Diff line change 1+ dsi.linux
2+ =========
3+
4+ .. automodule :: dsi.linux
5+ :members:
You can’t perform that action at this time.
0 commit comments