libTerm 0.2.6__tar.gz → 0.2.8__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.
Files changed (68) hide show
  1. {libterm-0.2.6 → libterm-0.2.8}/.gitignore +1 -1
  2. {libterm-0.2.6 → libterm-0.2.8}/.idea/libTerm.iml +1 -1
  3. {libterm-0.2.6 → libterm-0.2.8}/.idea/workspace.xml +93 -72
  4. libterm-0.2.8/Examples/__init__.py +8 -0
  5. {libterm-0.2.6 → libterm-0.2.8}/Examples/ex_arrowkeys.py +0 -0
  6. {libterm-0.2.6 → libterm-0.2.8}/Examples/ex_autosnake.py +9 -6
  7. libterm-0.2.6/Examples/example.py → libterm-0.2.8/Examples/ex_basic.py +0 -0
  8. {libterm-0.2.6 → libterm-0.2.8}/Examples/ex_colors.py +0 -0
  9. {libterm-0.2.6 → libterm-0.2.8}/Examples/ex_manualsnake.py +30 -10
  10. {libterm-0.2.6 → libterm-0.2.8}/Examples/ex_printkeys.py +0 -0
  11. libterm-0.2.8/Examples/ex_simplemenu.py +48 -0
  12. libterm-0.2.8/Examples/time +200440 -0
  13. {libterm-0.2.6 → libterm-0.2.8}/PKG-INFO +1 -1
  14. libterm-0.2.8/dist/libterm-0.2.6-py3-none-any.whl +0 -0
  15. libterm-0.2.8/dist/libterm-0.2.6.tar.gz +0 -0
  16. libterm-0.2.8/dist/libterm-0.2.7-py3-none-any.whl +0 -0
  17. libterm-0.2.8/dist/libterm-0.2.7.tar.gz +0 -0
  18. {libterm-0.2.6 → libterm-0.2.8}/pyproject.toml +1 -1
  19. libterm-0.2.8/src/libTerm/__init__.py +6 -0
  20. libterm-0.2.8/src/libTerm/libextra/class_menu.py +64 -0
  21. libterm-0.2.8/src/libTerm/term/__init__.py +15 -0
  22. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm/term/cursor.py +16 -12
  23. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm/term/input.py +0 -2
  24. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm/term/mock.py +1 -1
  25. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm/term/posix.py +17 -15
  26. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm/term/virt.py +79 -27
  27. libterm-0.2.8/src/libTerm/types/__init__.py +1 -0
  28. libterm-0.2.6/src/libTerm/types.py → libterm-0.2.8/src/libTerm/types/base.py +303 -184
  29. libterm-0.2.8/src/libTerm/types/enums.py +29 -0
  30. libterm-0.2.8/src/libTerm/types/extra.py +1 -0
  31. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm.egg-info/PKG-INFO +1 -1
  32. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm.egg-info/SOURCES.txt +15 -3
  33. libterm-0.2.8/tests/test_selector.py +36 -0
  34. libterm-0.2.8/tests/test_store.py +25 -0
  35. libterm-0.2.6/Examples/ex_simplemenu.py +0 -83
  36. libterm-0.2.6/src/libTerm/__init__.py +0 -4
  37. libterm-0.2.6/src/libTerm/term/__init__.py +0 -13
  38. {libterm-0.2.6 → libterm-0.2.8}/.STATUS_TESTS +0 -0
  39. {libterm-0.2.6 → libterm-0.2.8}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
  40. {libterm-0.2.6 → libterm-0.2.8}/.idea/modules.xml +0 -0
  41. {libterm-0.2.6 → libterm-0.2.8}/.idea/vcs.xml +0 -0
  42. {libterm-0.2.6 → libterm-0.2.8}/0 +0 -0
  43. {libterm-0.2.6 → libterm-0.2.8}/README.md +0 -0
  44. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.0.1-py3-none-any.whl +0 -0
  45. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.0.1.tar.gz +0 -0
  46. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.0-py3-none-any.whl +0 -0
  47. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.0.tar.gz +0 -0
  48. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.5-py3-none-any.whl +0 -0
  49. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.5.tar.gz +0 -0
  50. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.6-py3-none-any.whl +0 -0
  51. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.6.tar.gz +0 -0
  52. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.7-py3-none-any.whl +0 -0
  53. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.1.7.tar.gz +0 -0
  54. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.2.0-py3-none-any.whl +0 -0
  55. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.2.0.tar.gz +0 -0
  56. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.2.5-py3-none-any.whl +0 -0
  57. {libterm-0.2.6 → libterm-0.2.8}/dist/libterm-0.2.5.tar.gz +0 -0
  58. {libterm-0.2.6 → libterm-0.2.8}/doc/dev/project.md +0 -0
  59. {libterm-0.2.6 → libterm-0.2.8}/libterm.cast +0 -0
  60. {libterm-0.2.6 → libterm-0.2.8}/libterm.gif +0 -0
  61. {libterm-0.2.6 → libterm-0.2.8}/setup.cfg +0 -0
  62. {libterm-0.2.6/Examples → libterm-0.2.8/src/libTerm/libextra}/__init__.py +0 -0
  63. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm/term/winnt.py +0 -0
  64. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm.egg-info/dependency_links.txt +0 -0
  65. {libterm-0.2.6 → libterm-0.2.8}/src/libTerm.egg-info/top_level.txt +0 -0
  66. {libterm-0.2.6 → libterm-0.2.8}/tests/__init__.py +0 -0
  67. {libterm-0.2.6 → libterm-0.2.8}/tests/test_cursor.py +0 -0
  68. {libterm-0.2.6 → libterm-0.2.8}/tests/test_posix_term.py +0 -0
@@ -15,7 +15,7 @@ __pycache__/
15
15
  # Distribution / packaging
16
16
  .Python
17
17
  build/
18
- develop-eggs/
18
+ develop-eggs/cd
19
19
  downloads/
20
20
  eggs/
21
21
  .eggs/
@@ -8,7 +8,7 @@
8
8
  <excludeFolder url="file://$MODULE_DIR$/build" />
9
9
  <excludeFolder url="file://$MODULE_DIR$/dist" />
10
10
  </content>
11
- <orderEntry type="jdk" jdkName="Python 3.12 virtualenv at /run/media/jeroen/CCCOMA_X64FRE_EN-GB_DV9/python/libTerm/.venv" jdkType="Python SDK" />
11
+ <orderEntry type="jdk" jdkName="Python 3.12 virtualenv at ~/Development/Code/Python/Projects/libTerm/.venv" jdkType="Python SDK" />
12
12
  <orderEntry type="sourceFolder" forTests="false" />
13
13
  </component>
14
14
  </module>
@@ -4,16 +4,17 @@
4
4
  <option name="autoReloadType" value="SELECTIVE" />
5
5
  </component>
6
6
  <component name="ChangeListManager">
7
- <list default="true" id="bc73ff2f-338a-4651-a389-91491c2041b6" name="Changes" comment="added tests , prolly not that usefull as its only testing if stuff exists , and written by copilot">
8
- <change afterPath="$PROJECT_DIR$/Examples/ex_printkeys.py" afterDir="false" />
9
- <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
10
- <change beforePath="$PROJECT_DIR$/Examples/ex_simplemenu.py" beforeDir="false" afterPath="$PROJECT_DIR$/Examples/ex_simplemenu.py" afterDir="false" />
11
- </list>
7
+ <list default="true" id="bc73ff2f-338a-4651-a389-91491c2041b6" name="Changes" comment="added tests , prolly not that usefull as its only testing if stuff exists , and written by copilot" />
12
8
  <option name="SHOW_DIALOG" value="false" />
13
9
  <option name="HIGHLIGHT_CONFLICTS" value="true" />
14
10
  <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
15
11
  <option name="LAST_RESOLUTION" value="IGNORE" />
16
12
  </component>
13
+ <component name="CopilotPersistence">
14
+ <persistenceIdMap>
15
+ <entry key="_/home/jeroen/Development/Code/Python/Projects/libTerm" value="32XLRp94VBFj5lgNkdim9ARFbbU" />
16
+ </persistenceIdMap>
17
+ </component>
17
18
  <component name="FileTemplateManagerImpl">
18
19
  <option name="RECENT_TEMPLATES">
19
20
  <list>
@@ -39,6 +40,9 @@
39
40
  <component name="HighlightingSettingsPerFile">
40
41
  <setting file="file://$USER_HOME$/.cache/JetBrains/PyCharmCE2025.1/python_stubs/-1711940630/termios.py" root0="SKIP_INSPECTION" />
41
42
  <setting file="file://$USER_HOME$/.cache/JetBrains/PyCharmCE2025.1/python_stubs/1055943265/termios.py" root0="SKIP_INSPECTION" />
43
+ <setting file="file://$PROJECT_DIR$/Examples/ex_autosnake.py" root0="SKIP_INSPECTION" />
44
+ <setting file="file://$PROJECT_DIR$/Examples/ex_simplemenu.py" root0="FORCE_HIGHLIGHTING" />
45
+ <setting file="file://$APPLICATION_HOME_DIR$/plugins/python-ce/helpers/pydev/_pydev_imps/_pydev_execfile.py" root0="SKIP_INSPECTION" />
42
46
  </component>
43
47
  <component name="ProjectColorInfo">{
44
48
  &quot;associatedIndex&quot;: 1
@@ -51,46 +55,51 @@
51
55
  <option name="hideEmptyMiddlePackages" value="true" />
52
56
  <option name="showLibraryContents" value="true" />
53
57
  </component>
54
- <component name="PropertiesComponent"><![CDATA[{
55
- "keyToString": {
56
- "ModuleVcsDetector.initialDetectionPerformed": "true",
57
- "Python tests.Python tests for ex_snake1.test_cursor.executor": "Run",
58
- "Python tests.Python tests for test_cursor.TestCursor.executor": "Run",
59
- "Python tests.Python tests for test_cursor.TestCursor.test_ansi_enum_repr.executor": "Run",
60
- "Python tests.Python tests for test_cursor.TestCursor.test_cursor.executor": "Run",
61
- "Python tests.Python tests for test_posix_term.TestPosixTerm.executor": "Run",
62
- "Python tests.Python tests for test_posix_term.TestPosixTerm.test_cursor.executor": "Run",
63
- "Python tests.Python tests for test_posix_term.TestPosixTerm.test_cursor2.executor": "Run",
64
- "Python tests.Python tests for test_snake1.test_cursor.executor": "Run",
65
- "Python tests.Python tests in ex3.py.executor": "Run",
66
- "Python tests.Python tests in test_cursor.py.executor": "Run",
67
- "Python tests.Python tests in test_posix_term.py.executor": "Run",
68
- "Python tests.Python tests in tests.executor": "Run",
69
- "Python.__init__ (1).executor": "Run",
70
- "Python.__init__.executor": "Run",
71
- "Python.ex3.executor": "Run",
72
- "Python.ex_arrowkeys.executor": "Run",
73
- "Python.ex_autosnake.executor": "Run",
74
- "Python.ex_colors.executor": "Run",
75
- "Python.ex_manualsnake.executor": "Run",
76
- "Python.ex_printkeys.executor": "Run",
77
- "Python.ex_simplemenu.executor": "Run",
78
- "Python.ex_snake1.executor": "Run",
79
- "Python.example.executor": "Run",
80
- "Python.posix.executor": "Run",
81
- "Python.python -m build.executor": "Run",
82
- "Python.python -m twine upload dist/*.executor": "Run",
83
- "Python.test.executor": "Run",
84
- "Python.types.executor": "Run",
85
- "Python.virt.executor": "Run",
86
- "RunOnceActivity.ShowReadmeOnStart": "true",
87
- "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager": "true",
88
- "RunOnceActivity.git.unshallow": "true",
89
- "git-widget-placeholder": "master",
90
- "last_opened_file_path": "/run/media/jeroen/CCCOMA_X64FRE_EN-GB_DV9/python/libTerm/.local/venvs/x64.linux.cpython-3.12.9/bin/python",
91
- "settings.editor.selected.configurable": "preferences.sourceCode.Python"
58
+ <component name="PropertiesComponent">{
59
+ &quot;keyToString&quot;: {
60
+ &quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
61
+ &quot;Python tests.Python tests for ex_snake1.test_cursor.executor&quot;: &quot;Run&quot;,
62
+ &quot;Python tests.Python tests for test_cursor.TestCursor.executor&quot;: &quot;Run&quot;,
63
+ &quot;Python tests.Python tests for test_cursor.TestCursor.test_ansi_enum_repr.executor&quot;: &quot;Run&quot;,
64
+ &quot;Python tests.Python tests for test_cursor.TestCursor.test_cursor.executor&quot;: &quot;Run&quot;,
65
+ &quot;Python tests.Python tests for test_posix_term.TestPosixTerm.executor&quot;: &quot;Run&quot;,
66
+ &quot;Python tests.Python tests for test_posix_term.TestPosixTerm.test_cursor.executor&quot;: &quot;Run&quot;,
67
+ &quot;Python tests.Python tests for test_posix_term.TestPosixTerm.test_cursor2.executor&quot;: &quot;Run&quot;,
68
+ &quot;Python tests.Python tests for test_snake1.test_cursor.executor&quot;: &quot;Run&quot;,
69
+ &quot;Python tests.Python tests in ex3.py.executor&quot;: &quot;Run&quot;,
70
+ &quot;Python tests.Python tests in test_cursor.py.executor&quot;: &quot;Run&quot;,
71
+ &quot;Python tests.Python tests in test_posix_term.py.executor&quot;: &quot;Run&quot;,
72
+ &quot;Python tests.Python tests in tests.executor&quot;: &quot;Run&quot;,
73
+ &quot;Python.__init__ (1).executor&quot;: &quot;Run&quot;,
74
+ &quot;Python.__init__.executor&quot;: &quot;Run&quot;,
75
+ &quot;Python.base.executor&quot;: &quot;Run&quot;,
76
+ &quot;Python.class_menu (1).executor&quot;: &quot;Run&quot;,
77
+ &quot;Python.class_menu.executor&quot;: &quot;Run&quot;,
78
+ &quot;Python.cursor.executor&quot;: &quot;Run&quot;,
79
+ &quot;Python.ex3.executor&quot;: &quot;Run&quot;,
80
+ &quot;Python.ex_arrowkeys.executor&quot;: &quot;Run&quot;,
81
+ &quot;Python.ex_autosnake.executor&quot;: &quot;Run&quot;,
82
+ &quot;Python.ex_colors.executor&quot;: &quot;Run&quot;,
83
+ &quot;Python.ex_manualsnake.executor&quot;: &quot;Run&quot;,
84
+ &quot;Python.ex_printkeys.executor&quot;: &quot;Debug&quot;,
85
+ &quot;Python.ex_simplemenu.executor&quot;: &quot;Run&quot;,
86
+ &quot;Python.ex_snake1.executor&quot;: &quot;Run&quot;,
87
+ &quot;Python.example.executor&quot;: &quot;Run&quot;,
88
+ &quot;Python.posix.executor&quot;: &quot;Run&quot;,
89
+ &quot;Python.python -m build.executor&quot;: &quot;Run&quot;,
90
+ &quot;Python.python -m twine upload dist/*.executor&quot;: &quot;Run&quot;,
91
+ &quot;Python.scratch_37.executor&quot;: &quot;Run&quot;,
92
+ &quot;Python.test.executor&quot;: &quot;Run&quot;,
93
+ &quot;Python.types.executor&quot;: &quot;Run&quot;,
94
+ &quot;Python.virt.executor&quot;: &quot;Run&quot;,
95
+ &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
96
+ &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager&quot;: &quot;true&quot;,
97
+ &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
98
+ &quot;git-widget-placeholder&quot;: &quot;master&quot;,
99
+ &quot;last_opened_file_path&quot;: &quot;/home/jeroen/Development/Code/Python/Projects/libTerm/.venv/bin/python&quot;,
100
+ &quot;settings.editor.selected.configurable&quot;: &quot;com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable&quot;
92
101
  }
93
- }]]></component>
102
+ }</component>
94
103
  <component name="RecentsManager">
95
104
  <key name="CopyFile.RECENT_KEYS">
96
105
  <recent name="H:\libTerm" />
@@ -98,11 +107,13 @@
98
107
  </key>
99
108
  <key name="MoveFile.RECENT_KEYS">
100
109
  <recent name="$PROJECT_DIR$/Examples" />
110
+ <recent name="$PROJECT_DIR$/libextra" />
111
+ <recent name="$PROJECT_DIR$/src/libTerm" />
101
112
  <recent name="$PROJECT_DIR$/.local/venvs" />
102
113
  </key>
103
114
  </component>
104
- <component name="RunManager" selected="Python.ex_printkeys">
105
- <configuration name="ex_autosnake" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
115
+ <component name="RunManager" selected="Python.ex_autosnake">
116
+ <configuration name="base" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
106
117
  <module name="libTerm" />
107
118
  <option name="ENV_FILES" value="" />
108
119
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -111,20 +122,20 @@
111
122
  <env name="PYTHONUNBUFFERED" value="1" />
112
123
  </envs>
113
124
  <option name="SDK_HOME" value="" />
114
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Examples" />
125
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/libTerm/types" />
115
126
  <option name="IS_MODULE_SDK" value="true" />
116
127
  <option name="ADD_CONTENT_ROOTS" value="true" />
117
128
  <option name="ADD_SOURCE_ROOTS" value="true" />
118
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_autosnake.py" />
129
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/libTerm/types/base.py" />
119
130
  <option name="PARAMETERS" value="" />
120
131
  <option name="SHOW_COMMAND_LINE" value="false" />
121
- <option name="EMULATE_TERMINAL" value="true" />
132
+ <option name="EMULATE_TERMINAL" value="false" />
122
133
  <option name="MODULE_MODE" value="false" />
123
134
  <option name="REDIRECT_INPUT" value="false" />
124
135
  <option name="INPUT_FILE" value="" />
125
136
  <method v="2" />
126
137
  </configuration>
127
- <configuration name="ex_colors" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
138
+ <configuration name="cursor" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
128
139
  <module name="libTerm" />
129
140
  <option name="ENV_FILES" value="" />
130
141
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -133,11 +144,11 @@
133
144
  <env name="PYTHONUNBUFFERED" value="1" />
134
145
  </envs>
135
146
  <option name="SDK_HOME" value="" />
136
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Examples" />
147
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/libTerm/term" />
137
148
  <option name="IS_MODULE_SDK" value="true" />
138
149
  <option name="ADD_CONTENT_ROOTS" value="true" />
139
150
  <option name="ADD_SOURCE_ROOTS" value="true" />
140
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_colors.py" />
151
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/libTerm/term/cursor.py" />
141
152
  <option name="PARAMETERS" value="" />
142
153
  <option name="SHOW_COMMAND_LINE" value="false" />
143
154
  <option name="EMULATE_TERMINAL" value="true" />
@@ -146,7 +157,7 @@
146
157
  <option name="INPUT_FILE" value="" />
147
158
  <method v="2" />
148
159
  </configuration>
149
- <configuration name="ex_manualsnake" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
160
+ <configuration name="ex_autosnake" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
150
161
  <module name="libTerm" />
151
162
  <option name="ENV_FILES" value="" />
152
163
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -159,16 +170,16 @@
159
170
  <option name="IS_MODULE_SDK" value="true" />
160
171
  <option name="ADD_CONTENT_ROOTS" value="true" />
161
172
  <option name="ADD_SOURCE_ROOTS" value="true" />
162
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_manualsnake.py" />
173
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_autosnake.py" />
163
174
  <option name="PARAMETERS" value="" />
164
175
  <option name="SHOW_COMMAND_LINE" value="false" />
165
- <option name="EMULATE_TERMINAL" value="false" />
176
+ <option name="EMULATE_TERMINAL" value="true" />
166
177
  <option name="MODULE_MODE" value="false" />
167
178
  <option name="REDIRECT_INPUT" value="false" />
168
179
  <option name="INPUT_FILE" value="" />
169
180
  <method v="2" />
170
181
  </configuration>
171
- <configuration name="ex_printkeys" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
182
+ <configuration name="ex_colors" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
172
183
  <module name="libTerm" />
173
184
  <option name="ENV_FILES" value="" />
174
185
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -181,7 +192,7 @@
181
192
  <option name="IS_MODULE_SDK" value="true" />
182
193
  <option name="ADD_CONTENT_ROOTS" value="true" />
183
194
  <option name="ADD_SOURCE_ROOTS" value="true" />
184
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_printkeys.py" />
195
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_colors.py" />
185
196
  <option name="PARAMETERS" value="" />
186
197
  <option name="SHOW_COMMAND_LINE" value="false" />
187
198
  <option name="EMULATE_TERMINAL" value="true" />
@@ -190,7 +201,7 @@
190
201
  <option name="INPUT_FILE" value="" />
191
202
  <method v="2" />
192
203
  </configuration>
193
- <configuration name="ex_simplemenu" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
204
+ <configuration name="ex_manualsnake" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
194
205
  <module name="libTerm" />
195
206
  <option name="ENV_FILES" value="" />
196
207
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -203,16 +214,16 @@
203
214
  <option name="IS_MODULE_SDK" value="true" />
204
215
  <option name="ADD_CONTENT_ROOTS" value="true" />
205
216
  <option name="ADD_SOURCE_ROOTS" value="true" />
206
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_simplemenu.py" />
217
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_manualsnake.py" />
207
218
  <option name="PARAMETERS" value="" />
208
219
  <option name="SHOW_COMMAND_LINE" value="false" />
209
- <option name="EMULATE_TERMINAL" value="false" />
220
+ <option name="EMULATE_TERMINAL" value="true" />
210
221
  <option name="MODULE_MODE" value="false" />
211
222
  <option name="REDIRECT_INPUT" value="false" />
212
223
  <option name="INPUT_FILE" value="" />
213
224
  <method v="2" />
214
225
  </configuration>
215
- <configuration name="example" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
226
+ <configuration name="ex_simplemenu" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
216
227
  <module name="libTerm" />
217
228
  <option name="ENV_FILES" value="" />
218
229
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -221,11 +232,11 @@
221
232
  <env name="PYTHONUNBUFFERED" value="1" />
222
233
  </envs>
223
234
  <option name="SDK_HOME" value="" />
224
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/tests" />
235
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Examples" />
225
236
  <option name="IS_MODULE_SDK" value="true" />
226
237
  <option name="ADD_CONTENT_ROOTS" value="true" />
227
238
  <option name="ADD_SOURCE_ROOTS" value="true" />
228
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/example.py" />
239
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/ex_simplemenu.py" />
229
240
  <option name="PARAMETERS" value="" />
230
241
  <option name="SHOW_COMMAND_LINE" value="false" />
231
242
  <option name="EMULATE_TERMINAL" value="true" />
@@ -234,7 +245,7 @@
234
245
  <option name="INPUT_FILE" value="" />
235
246
  <method v="2" />
236
247
  </configuration>
237
- <configuration name="virt" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
248
+ <configuration name="example" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
238
249
  <module name="libTerm" />
239
250
  <option name="ENV_FILES" value="" />
240
251
  <option name="INTERPRETER_OPTIONS" value="" />
@@ -243,14 +254,14 @@
243
254
  <env name="PYTHONUNBUFFERED" value="1" />
244
255
  </envs>
245
256
  <option name="SDK_HOME" value="" />
246
- <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/src/libTerm/term" />
257
+ <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/tests" />
247
258
  <option name="IS_MODULE_SDK" value="true" />
248
259
  <option name="ADD_CONTENT_ROOTS" value="true" />
249
260
  <option name="ADD_SOURCE_ROOTS" value="true" />
250
- <option name="SCRIPT_NAME" value="$PROJECT_DIR$/src/libTerm/term/virt.py" />
261
+ <option name="SCRIPT_NAME" value="$PROJECT_DIR$/Examples/example.py" />
251
262
  <option name="PARAMETERS" value="" />
252
263
  <option name="SHOW_COMMAND_LINE" value="false" />
253
- <option name="EMULATE_TERMINAL" value="false" />
264
+ <option name="EMULATE_TERMINAL" value="true" />
254
265
  <option name="MODULE_MODE" value="false" />
255
266
  <option name="REDIRECT_INPUT" value="false" />
256
267
  <option name="INPUT_FILE" value="" />
@@ -258,11 +269,11 @@
258
269
  </configuration>
259
270
  <recent_temporary>
260
271
  <list>
261
- <item itemvalue="Python.ex_printkeys" />
262
- <item itemvalue="Python.ex_simplemenu" />
263
- <item itemvalue="Python.ex_manualsnake" />
264
- <item itemvalue="Python.virt" />
265
272
  <item itemvalue="Python.ex_autosnake" />
273
+ <item itemvalue="Python.ex_manualsnake" />
274
+ <item itemvalue="Python.cursor" />
275
+ <item itemvalue="Python.base" />
276
+ <item itemvalue="Python.ex_simplemenu" />
266
277
  </list>
267
278
  </recent_temporary>
268
279
  </component>
@@ -330,9 +341,19 @@
330
341
  <breakpoints>
331
342
  <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
332
343
  <url>file://$PROJECT_DIR$/src/libTerm/term/cursor.py</url>
333
- <line>105</line>
344
+ <line>106</line>
334
345
  <option name="timeStamp" value="3" />
335
346
  </line-breakpoint>
347
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
348
+ <url>file://$PROJECT_DIR$/src/libTerm/types.py</url>
349
+ <line>252</line>
350
+ <option name="timeStamp" value="4" />
351
+ </line-breakpoint>
352
+ <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
353
+ <url>file://$PROJECT_DIR$/src/libTerm/types.py</url>
354
+ <line>371</line>
355
+ <option name="timeStamp" value="6" />
356
+ </line-breakpoint>
336
357
  </breakpoints>
337
358
  </breakpoint-manager>
338
359
  </component>
@@ -0,0 +1,8 @@
1
+ # /usr/bin/env pyhthon
2
+ import ex_autosnake
3
+ import ex_colors
4
+ import ex_manualsnake
5
+ import ex_simplemenu
6
+ import ex_arrowkeys
7
+ import ex_printkeys
8
+ import ex_basic
@@ -1,6 +1,5 @@
1
1
  # /usr/bin/env pyhthon
2
- from libTerm import Term
3
- from libTerm import Coord,Mode
2
+ from libTerm import Term,Coord,Mode
4
3
  import time
5
4
 
6
5
 
@@ -16,8 +15,11 @@ class Snake():
16
15
  s.term.cursor.save()
17
16
 
18
17
  def rempiece(s):
19
- s.term.cursor.undo()
20
- print('\x1b[D ', end='', flush=True)
18
+ step=s.term.cursor.undo()
19
+ if step is not None:
20
+ print('\x1b[D ', end='', flush=True)
21
+ else:
22
+ return step
21
23
  def down(s):
22
24
  print('\x1b[B\x1b[D', end='', flush=True)
23
25
  s.addpiece()
@@ -35,7 +37,7 @@ t.echo=False
35
37
  t.cursor.show(False)
36
38
  print('\n\n\n\n\n\n\n')
37
39
  t.mode=Mode.CONTROL
38
- vert=t.size.xy.y
40
+ vert=t.size.rc.y
39
41
  print(vert)
40
42
  snake=Snake(t,speed=100)
41
43
  time.sleep(2)
@@ -54,8 +56,9 @@ for i in range(8):
54
56
  snake.right()
55
57
  time.sleep(snake.speed)
56
58
 
57
- while t.cursor.store.selected:
59
+ while t.cursor.store.selected is not None:
58
60
  snake.rempiece()
61
+
59
62
  time.sleep(snake.speed)
60
63
 
61
64
 
File without changes
@@ -1,10 +1,10 @@
1
- # /usr/bin/env pyhthon
1
+ # /usr/bin/env python
2
2
 
3
3
  import time
4
- from libTerm import Term
5
- from libTerm import Coord,Mode,Color
4
+ from libTerm import Term, Mode, Color, Coord
5
+ from libTerm.types.enums import Stop
6
6
 
7
- class Snake():
7
+ class Snake:
8
8
  def __init__(s,t,speed=10):
9
9
  s.speed=1 / (speed or 1)
10
10
  s.term=t
@@ -15,14 +15,21 @@ class Snake():
15
15
  s.term.cursor.save()
16
16
 
17
17
  def rempiece(s):
18
- s.term.cursor.undo()
18
+ current=s.term.cursor.undo()
19
19
  print('\x1b[D ', end='', flush=True)
20
+ if current==Stop.FIRST_OF_STORE:
21
+ return current
22
+
20
23
 
21
24
  term=Term()
22
25
  term.mode=Mode.CONTROL
23
- snake=Snake(term)
24
26
  term.buffer.switch()
27
+
28
+
29
+ # time.sleep(5)
30
+ snake=Snake(term)
25
31
  print('\x1b[J\x1b[1;1HPress one of up,down,left,right to start and q to quit!')
32
+ seq=''
26
33
  while True:
27
34
  if term.stdin.event:
28
35
  key=term.stdin.read()
@@ -35,11 +42,24 @@ while True:
35
42
  elif key=='\x1b[D':
36
43
  snake.piece = '\x1b[D\x1b[D░'
37
44
  elif key=='q':
38
- while term.cursor.store.selected:
39
- snake.rempiece()
40
- time.sleep(snake.speed)
41
- break
45
+ seq+='q'
46
+ if seq=='q':
47
+ print(term.cursor.store.values())
48
+ elif seq=='qq':
49
+ while term.cursor.store.selected:
50
+ end=snake.rempiece()
51
+ print(f'\x1b[s\x1b7\x1b[{2};1H', repr(term.cursor.xy), '\x1b[u\x1b8', end='', flush=True)
52
+ time.sleep(snake.speed)
53
+
54
+ if end in Stop:
55
+ break
56
+ break
42
57
  if snake.piece!='':
43
58
  snake.addpiece()
59
+ print(f'\x1b[s\x1b7\x1b[{2};1H',repr(term.cursor.xy),'\x1b[u\x1b8',end='',flush=True)
60
+
44
61
  time.sleep(snake.speed)
62
+
63
+
64
+
45
65
  term.buffer.default()
@@ -0,0 +1,48 @@
1
+ # /usr/bin/env pyhthon
2
+ import time,sys,os
3
+ from libTerm import Term,Color,Coord,Mode,Selector
4
+ from libTerm.libextra.class_menu import Menu
5
+ import asyncio
6
+
7
+
8
+ def Controls(term,M):
9
+ def controls():
10
+ key=term.stdin.read()
11
+ if key == '\x1b[B':
12
+ M.next()
13
+ elif key == '\x1b[A':
14
+ M.prev()
15
+ elif key == 'q':
16
+ term.buffer.default()
17
+ sys.exit()
18
+ elif key == '\n':
19
+ print('\x1b[1;1H chosen:',M.choose())
20
+ return controls
21
+
22
+ # return control
23
+ #
24
+ def makeMenu(term,items):
25
+ M=Menu(term,items ,xy=Coord(10,10))
26
+ M.draw()
27
+ return M
28
+ def main(items):
29
+ term = Term()
30
+ term.buffer.alternate()
31
+ term.mode = Mode.CONTROL
32
+
33
+ menu=makeMenu(term,items)
34
+ loop = asyncio.new_event_loop()
35
+ asyncio.set_event_loop(loop)
36
+ loop.add_reader(term.fd, Controls(term,menu))
37
+ loop.run_forever()
38
+
39
+ if __name__=='__main__':
40
+ items = ['a'*90, 'b'*95, 'c'*120, 'd'*115,'#'*90, 'K'*95, 'V'*120, '@'*115]
41
+ main([*items,*items,*items])
42
+
43
+
44
+
45
+
46
+
47
+
48
+