keyboardstream2py 0.1.2__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- keyboardstream2py-0.1.4/.gitignore +115 -0
- keyboardstream2py-0.1.4/PKG-INFO +24 -0
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/keyboardstream2py/getch.py +9 -9
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/keyboardstream2py/keyboard_input.py +6 -5
- keyboardstream2py-0.1.4/pyproject.toml +170 -0
- keyboardstream2py-0.1.2/PKG-INFO +0 -15
- keyboardstream2py-0.1.2/keyboardstream2py.egg-info/PKG-INFO +0 -15
- keyboardstream2py-0.1.2/keyboardstream2py.egg-info/SOURCES.txt +0 -15
- keyboardstream2py-0.1.2/keyboardstream2py.egg-info/dependency_links.txt +0 -1
- keyboardstream2py-0.1.2/keyboardstream2py.egg-info/not-zip-safe +0 -1
- keyboardstream2py-0.1.2/keyboardstream2py.egg-info/requires.txt +0 -1
- keyboardstream2py-0.1.2/keyboardstream2py.egg-info/top_level.txt +0 -1
- keyboardstream2py-0.1.2/setup.cfg +0 -25
- keyboardstream2py-0.1.2/setup.py +0 -3
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/LICENSE +0 -0
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/README.md +0 -0
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/keyboardstream2py/__init__.py +0 -0
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/keyboardstream2py/tests/__init__.py +0 -0
- {keyboardstream2py-0.1.2 → keyboardstream2py-0.1.4}/keyboardstream2py/tests/simple_test.py +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
docs/*
|
|
2
|
+
wads_configs.json
|
|
3
|
+
data/wads_configs.json
|
|
4
|
+
wads/data/wads_configs.json
|
|
5
|
+
|
|
6
|
+
# Byte-compiled / optimized / DLL files
|
|
7
|
+
__pycache__/
|
|
8
|
+
*.py[cod]
|
|
9
|
+
*$py.class
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
.DS_Store
|
|
13
|
+
# C extensions
|
|
14
|
+
*.so
|
|
15
|
+
|
|
16
|
+
# Distribution / packaging
|
|
17
|
+
.Python
|
|
18
|
+
build/
|
|
19
|
+
develop-eggs/
|
|
20
|
+
dist/
|
|
21
|
+
downloads/
|
|
22
|
+
eggs/
|
|
23
|
+
.eggs/
|
|
24
|
+
lib/
|
|
25
|
+
lib64/
|
|
26
|
+
parts/
|
|
27
|
+
sdist/
|
|
28
|
+
var/
|
|
29
|
+
wheels/
|
|
30
|
+
*.egg-info/
|
|
31
|
+
.installed.cfg
|
|
32
|
+
*.egg
|
|
33
|
+
MANIFEST
|
|
34
|
+
_build
|
|
35
|
+
|
|
36
|
+
# PyInstaller
|
|
37
|
+
# Usually these files are written by a python script from a template
|
|
38
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
39
|
+
*.manifest
|
|
40
|
+
*.spec
|
|
41
|
+
|
|
42
|
+
# Installer logs
|
|
43
|
+
pip-log.txt
|
|
44
|
+
pip-delete-this-directory.txt
|
|
45
|
+
|
|
46
|
+
# Unit test / coverage reports
|
|
47
|
+
htmlcov/
|
|
48
|
+
.tox/
|
|
49
|
+
.coverage
|
|
50
|
+
.coverage.*
|
|
51
|
+
.cache
|
|
52
|
+
nosetests.xml
|
|
53
|
+
coverage.xml
|
|
54
|
+
*.cover
|
|
55
|
+
.hypothesis/
|
|
56
|
+
.pytest_cache/
|
|
57
|
+
|
|
58
|
+
# Translations
|
|
59
|
+
*.mo
|
|
60
|
+
*.pot
|
|
61
|
+
|
|
62
|
+
# Django stuff:
|
|
63
|
+
*.log
|
|
64
|
+
local_settings.py
|
|
65
|
+
db.sqlite3
|
|
66
|
+
|
|
67
|
+
# Flask stuff:
|
|
68
|
+
instance/
|
|
69
|
+
.webassets-cache
|
|
70
|
+
|
|
71
|
+
# Scrapy stuff:
|
|
72
|
+
.scrapy
|
|
73
|
+
|
|
74
|
+
# Sphinx documentation
|
|
75
|
+
docs/_build/
|
|
76
|
+
|
|
77
|
+
# PyBuilder
|
|
78
|
+
target/
|
|
79
|
+
|
|
80
|
+
# Jupyter Notebook
|
|
81
|
+
.ipynb_checkpoints
|
|
82
|
+
|
|
83
|
+
# pyenv
|
|
84
|
+
.python-version
|
|
85
|
+
|
|
86
|
+
# celery beat schedule file
|
|
87
|
+
celerybeat-schedule
|
|
88
|
+
|
|
89
|
+
# SageMath parsed files
|
|
90
|
+
*.sage.py
|
|
91
|
+
|
|
92
|
+
# Environments
|
|
93
|
+
.env
|
|
94
|
+
.venv
|
|
95
|
+
env/
|
|
96
|
+
venv/
|
|
97
|
+
ENV/
|
|
98
|
+
env.bak/
|
|
99
|
+
venv.bak/
|
|
100
|
+
|
|
101
|
+
# Spyder project settings
|
|
102
|
+
.spyderproject
|
|
103
|
+
.spyproject
|
|
104
|
+
|
|
105
|
+
# Rope project settings
|
|
106
|
+
.ropeproject
|
|
107
|
+
|
|
108
|
+
# mkdocs documentation
|
|
109
|
+
/site
|
|
110
|
+
|
|
111
|
+
# mypy
|
|
112
|
+
.mypy_cache/
|
|
113
|
+
|
|
114
|
+
# PyCharm
|
|
115
|
+
.idea
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: keyboardstream2py
|
|
3
|
+
Version: 0.1.4
|
|
4
|
+
Summary: stream2py interface for keyboard inputs
|
|
5
|
+
Project-URL: Homepage, https://github.com/i2mint/keyboardstream2py
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.10
|
|
9
|
+
Requires-Dist: stream2py
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
|
|
12
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
13
|
+
Requires-Dist: ruff>=0.1.0; extra == 'dev'
|
|
14
|
+
Provides-Extra: docs
|
|
15
|
+
Requires-Dist: sphinx-rtd-theme>=1.0; extra == 'docs'
|
|
16
|
+
Requires-Dist: sphinx>=6.0; extra == 'docs'
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# keyboardstream2py
|
|
21
|
+
stream2py interface for keyboard inputs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
To install: ```pip install keyboardstream2py```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""The util to capture keyboard strokes"""
|
|
2
2
|
|
|
3
|
-
__all__ = [
|
|
3
|
+
__all__ = ["getch"]
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class _Getch:
|
|
@@ -107,26 +107,26 @@ def smoke_test_getch():
|
|
|
107
107
|
|
|
108
108
|
def getch_loop(is_blocking=True):
|
|
109
109
|
print(
|
|
110
|
-
f'
|
|
111
|
-
|
|
110
|
+
f"{'Blocking' if is_blocking is True else 'Non-blocking'} "
|
|
111
|
+
"getch! Press any key! Esc to quit!"
|
|
112
112
|
)
|
|
113
113
|
i = 0
|
|
114
114
|
getch_func = getch.blocking if is_blocking is True else getch.non_blocking
|
|
115
115
|
while True:
|
|
116
116
|
char = getch_func()
|
|
117
117
|
if char or i % 15000 == 0:
|
|
118
|
-
print(f
|
|
118
|
+
print(f"{i}: {char}")
|
|
119
119
|
|
|
120
|
-
if char ==
|
|
120
|
+
if char == "\x1b": # ESC key
|
|
121
121
|
break
|
|
122
122
|
i += 1
|
|
123
123
|
|
|
124
124
|
getch_file, *args = sys.argv
|
|
125
125
|
|
|
126
126
|
print(
|
|
127
|
-
|
|
128
|
-
f
|
|
129
|
-
f
|
|
127
|
+
"Getch! Echo key press usage:\n"
|
|
128
|
+
f"Blocking mode: python {getch_file}\n"
|
|
129
|
+
f"Non-blocking mode: python {getch_file} False\n"
|
|
130
130
|
)
|
|
131
131
|
|
|
132
|
-
getch_loop(is_blocking=False if len(args) and args[0] ==
|
|
132
|
+
getch_loop(is_blocking=False if len(args) and args[0] == "False" else True)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"""keyboard strokes input reader"""
|
|
2
|
+
|
|
2
3
|
from collections import deque
|
|
3
4
|
from contextlib import suppress
|
|
4
5
|
import operator
|
|
@@ -47,7 +48,7 @@ class KeyboardInputSourceReader(SourceReader, threading.Thread):
|
|
|
47
48
|
|
|
48
49
|
@property
|
|
49
50
|
def info(self) -> dict:
|
|
50
|
-
return {
|
|
51
|
+
return {"bt": self.bt}
|
|
51
52
|
|
|
52
53
|
def key(self, data: Any) -> ComparableType:
|
|
53
54
|
"""
|
|
@@ -73,14 +74,14 @@ class KeyboardInputSourceReader(SourceReader, threading.Thread):
|
|
|
73
74
|
raise
|
|
74
75
|
|
|
75
76
|
|
|
76
|
-
if __name__ ==
|
|
77
|
+
if __name__ == "__main__":
|
|
77
78
|
with KeyboardInputSourceReader() as source:
|
|
78
|
-
print(
|
|
79
|
+
print("getch! Press any key! Esc to quit!")
|
|
79
80
|
while True:
|
|
80
81
|
data = source.read()
|
|
81
82
|
if data is not None:
|
|
82
83
|
index, timestamp, char = data
|
|
83
|
-
print(f
|
|
84
|
+
print(f"{timestamp}: {char}", end="\n\r")
|
|
84
85
|
|
|
85
|
-
if char ==
|
|
86
|
+
if char == "\x1b": # ESC key
|
|
86
87
|
break
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = [
|
|
3
|
+
"hatchling",
|
|
4
|
+
]
|
|
5
|
+
build-backend = "hatchling.build"
|
|
6
|
+
|
|
7
|
+
[project]
|
|
8
|
+
name = "keyboardstream2py"
|
|
9
|
+
version = "0.1.4"
|
|
10
|
+
description = "stream2py interface for keyboard inputs"
|
|
11
|
+
readme = "README.md"
|
|
12
|
+
requires-python = ">=3.10"
|
|
13
|
+
license = "Apache-2.0"
|
|
14
|
+
keywords = []
|
|
15
|
+
authors = []
|
|
16
|
+
dependencies = [
|
|
17
|
+
"stream2py",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://github.com/i2mint/keyboardstream2py"
|
|
22
|
+
|
|
23
|
+
[project.optional-dependencies]
|
|
24
|
+
dev = [
|
|
25
|
+
"pytest>=7.0",
|
|
26
|
+
"pytest-cov>=4.0",
|
|
27
|
+
"ruff>=0.1.0",
|
|
28
|
+
]
|
|
29
|
+
docs = [
|
|
30
|
+
"sphinx>=6.0",
|
|
31
|
+
"sphinx-rtd-theme>=1.0",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[tool.hatch.build]
|
|
35
|
+
skip-excluded-dirs = true
|
|
36
|
+
|
|
37
|
+
[tool.hatch.build.targets.sdist]
|
|
38
|
+
exclude = [
|
|
39
|
+
".claude",
|
|
40
|
+
".github",
|
|
41
|
+
"scrap",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[tool.ruff]
|
|
45
|
+
line-length = 88
|
|
46
|
+
target-version = "py310"
|
|
47
|
+
exclude = [
|
|
48
|
+
"**/*.ipynb",
|
|
49
|
+
"**/*.md",
|
|
50
|
+
".git",
|
|
51
|
+
".venv",
|
|
52
|
+
"build",
|
|
53
|
+
"dist",
|
|
54
|
+
"tests",
|
|
55
|
+
"examples",
|
|
56
|
+
"scrap",
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
[tool.ruff.lint]
|
|
60
|
+
select = [
|
|
61
|
+
"D100",
|
|
62
|
+
]
|
|
63
|
+
ignore = [
|
|
64
|
+
"D203",
|
|
65
|
+
"E501",
|
|
66
|
+
"B905",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
[tool.ruff.lint.pydocstyle]
|
|
70
|
+
convention = "google"
|
|
71
|
+
|
|
72
|
+
[tool.ruff.lint.per-file-ignores]
|
|
73
|
+
"**/tests/*" = [
|
|
74
|
+
"D",
|
|
75
|
+
]
|
|
76
|
+
"**/examples/*" = [
|
|
77
|
+
"D",
|
|
78
|
+
]
|
|
79
|
+
"**/scrap/*" = [
|
|
80
|
+
"D",
|
|
81
|
+
]
|
|
82
|
+
|
|
83
|
+
[tool.pytest.ini_options]
|
|
84
|
+
minversion = "6.0"
|
|
85
|
+
testpaths = [
|
|
86
|
+
"keyboardstream2py",
|
|
87
|
+
]
|
|
88
|
+
doctest_optionflags = [
|
|
89
|
+
"NORMALIZE_WHITESPACE",
|
|
90
|
+
"ELLIPSIS",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
[tool.wads.ci]
|
|
94
|
+
project_name = ""
|
|
95
|
+
|
|
96
|
+
[tool.wads.ci.install]
|
|
97
|
+
extras = "dev"
|
|
98
|
+
|
|
99
|
+
[tool.wads.ci.commands]
|
|
100
|
+
pre_test = []
|
|
101
|
+
test = []
|
|
102
|
+
post_test = []
|
|
103
|
+
lint = []
|
|
104
|
+
format = []
|
|
105
|
+
|
|
106
|
+
[tool.wads.ci.env]
|
|
107
|
+
required_envvars = []
|
|
108
|
+
test_envvars = []
|
|
109
|
+
extra_envvars = []
|
|
110
|
+
|
|
111
|
+
[tool.wads.ci.env.defaults]
|
|
112
|
+
|
|
113
|
+
[tool.wads.ci.quality.ruff]
|
|
114
|
+
enabled = true
|
|
115
|
+
|
|
116
|
+
[tool.wads.ci.quality.black]
|
|
117
|
+
enabled = false
|
|
118
|
+
|
|
119
|
+
[tool.wads.ci.quality.mypy]
|
|
120
|
+
enabled = false
|
|
121
|
+
|
|
122
|
+
[tool.wads.ci.testing]
|
|
123
|
+
enabled = true
|
|
124
|
+
python_versions = [
|
|
125
|
+
"3.10",
|
|
126
|
+
"3.12",
|
|
127
|
+
]
|
|
128
|
+
pytest_args = [
|
|
129
|
+
"-v",
|
|
130
|
+
"--tb=short",
|
|
131
|
+
]
|
|
132
|
+
coverage_enabled = true
|
|
133
|
+
coverage_threshold = 0
|
|
134
|
+
coverage_report_format = [
|
|
135
|
+
"term",
|
|
136
|
+
"xml",
|
|
137
|
+
]
|
|
138
|
+
exclude_paths = [
|
|
139
|
+
"examples",
|
|
140
|
+
"scrap",
|
|
141
|
+
"keyboardstream2py/getch.py",
|
|
142
|
+
]
|
|
143
|
+
test_on_windows = true
|
|
144
|
+
|
|
145
|
+
[tool.wads.ci.metrics]
|
|
146
|
+
enabled = true
|
|
147
|
+
config_path = ".github/umpyre-config.yml"
|
|
148
|
+
storage_branch = "code-metrics"
|
|
149
|
+
python_version = "3.10"
|
|
150
|
+
force_run = false
|
|
151
|
+
|
|
152
|
+
[tool.wads.ci.build]
|
|
153
|
+
sdist = true
|
|
154
|
+
wheel = true
|
|
155
|
+
|
|
156
|
+
[tool.wads.ci.publish]
|
|
157
|
+
enabled = true
|
|
158
|
+
skip_ci_marker = "[skip ci]"
|
|
159
|
+
publish_marker = "[publish]"
|
|
160
|
+
skip_publish_marker = "[skip publish]"
|
|
161
|
+
|
|
162
|
+
[tool.wads.ci.docs]
|
|
163
|
+
enabled = true
|
|
164
|
+
skip_marker = "[skip github-pages]"
|
|
165
|
+
builder = "epythet"
|
|
166
|
+
ignore_paths = [
|
|
167
|
+
"tests/",
|
|
168
|
+
"scrap/",
|
|
169
|
+
"examples/",
|
|
170
|
+
]
|
keyboardstream2py-0.1.2/PKG-INFO
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: keyboardstream2py
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: stream2py interface for keyboard inputs
|
|
5
|
-
Home-page: https://github.com/i2mint/keyboardstream2py
|
|
6
|
-
License: apache-2.0
|
|
7
|
-
Description:
|
|
8
|
-
# keyboardstream2py
|
|
9
|
-
stream2py interface for keyboard inputs
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
To install: ```pip install keyboardstream2py```
|
|
13
|
-
|
|
14
|
-
Platform: any
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: keyboardstream2py
|
|
3
|
-
Version: 0.1.2
|
|
4
|
-
Summary: stream2py interface for keyboard inputs
|
|
5
|
-
Home-page: https://github.com/i2mint/keyboardstream2py
|
|
6
|
-
License: apache-2.0
|
|
7
|
-
Description:
|
|
8
|
-
# keyboardstream2py
|
|
9
|
-
stream2py interface for keyboard inputs
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
To install: ```pip install keyboardstream2py```
|
|
13
|
-
|
|
14
|
-
Platform: any
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
setup.cfg
|
|
4
|
-
setup.py
|
|
5
|
-
keyboardstream2py/__init__.py
|
|
6
|
-
keyboardstream2py/getch.py
|
|
7
|
-
keyboardstream2py/keyboard_input.py
|
|
8
|
-
keyboardstream2py.egg-info/PKG-INFO
|
|
9
|
-
keyboardstream2py.egg-info/SOURCES.txt
|
|
10
|
-
keyboardstream2py.egg-info/dependency_links.txt
|
|
11
|
-
keyboardstream2py.egg-info/not-zip-safe
|
|
12
|
-
keyboardstream2py.egg-info/requires.txt
|
|
13
|
-
keyboardstream2py.egg-info/top_level.txt
|
|
14
|
-
keyboardstream2py/tests/__init__.py
|
|
15
|
-
keyboardstream2py/tests/simple_test.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
stream2py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
keyboardstream2py
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
[metadata]
|
|
2
|
-
name = keyboardstream2py
|
|
3
|
-
version = 0.1.2
|
|
4
|
-
url = https://github.com/i2mint/keyboardstream2py
|
|
5
|
-
platforms = any
|
|
6
|
-
description_file = README.md
|
|
7
|
-
root_url = https://github.com/i2mint/
|
|
8
|
-
license = apache-2.0
|
|
9
|
-
description = stream2py interface for keyboard inputs
|
|
10
|
-
long_description = file:README.md
|
|
11
|
-
long_description_content_type = text/markdown
|
|
12
|
-
keywords =
|
|
13
|
-
display_name = keyboardstream2py
|
|
14
|
-
|
|
15
|
-
[options]
|
|
16
|
-
packages = find:
|
|
17
|
-
include_package_data = True
|
|
18
|
-
zip_safe = False
|
|
19
|
-
install_requires =
|
|
20
|
-
stream2py
|
|
21
|
-
|
|
22
|
-
[egg_info]
|
|
23
|
-
tag_build =
|
|
24
|
-
tag_date = 0
|
|
25
|
-
|
keyboardstream2py-0.1.2/setup.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|