Skip to content

Commit 568a4a5

Browse files
made dsi releass ready
1 parent 7aa22fd commit 568a4a5

File tree

15 files changed

+197
-17
lines changed

15 files changed

+197
-17
lines changed

README.md

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,57 @@
11
# DSI (Display Server Interactions)
22

33
DSI 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
1115
from dsi import DSI
12-
1316
window = DSI.get_active_window()
17+
```
18+
19+
### Get basic window information
1420

21+
```python
1522
print("Active window: ")
1623
print("\tName: {}".format(window.name))
1724
print("\tPID: {}".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) & 0xFF == 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+
```

docs/README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
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
68
pip install -Ur requirements.txt
@@ -11,3 +13,7 @@ pip install -Ur requirements.txt
1113
```sh
1214
make 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

docs/source/conf.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff 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.
5252
extensions = [
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:
7780
html_static_path = ['_static']
7881

7982
intersphinx_mapping = {"python": ("http://docs.python.org/3", None)}
83+
84+
autodoc_default_options = {
85+
'member-order': 'bysource',
86+
'undoc-members': True,
87+
}

docs/source/get_window.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
================
21
Getting a Window
32
================
43

docs/source/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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

1112
Indices and tables
1213
==================

docs/source/os_specific_code.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
================
21
OS specific code
32
================
43

docs/source/reference.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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

docs/source/reference/base.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dsi.base.DSIBase
2+
================
3+
4+
5+
.. autoclass:: dsi.base.DSIBase
6+
:members:

docs/source/reference/image.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dsi.image.Image
2+
===============
3+
4+
5+
.. autoclass:: dsi.image.Image
6+
:members:

docs/source/reference/linux.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dsi.linux
2+
=========
3+
4+
.. automodule:: dsi.linux
5+
:members:

0 commit comments

Comments
 (0)