termcap 0.1.0__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.
termcap-0.1.0/LICENSE ADDED
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2018, Nicolas Bedos
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ * Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ * Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,7 @@
1
+ include LICENSE
2
+ include scripts/*
3
+ recursive-include termtosvg/data *
4
+ global-exclude __pycache__ *.pyc
5
+
6
+ # Artifacts generated by the CI/CD pipeline
7
+ include man/*.man.?
termcap-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,49 @@
1
+ Metadata-Version: 2.4
2
+ Name: termcap
3
+ Version: 0.1.0
4
+ Summary: Terminal capture tool - Record terminal sessions as SVG animations
5
+ Home-page: https://github.com/rexwzh/termcap
6
+ Author: rexwzh
7
+ Author-email: 1073853456@qq.com
8
+ License: BSD 3-clause license
9
+ Classifier: Environment :: Console
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: BSD License
12
+ Classifier: Operating System :: MacOS
13
+ Classifier: Operating System :: POSIX :: BSD
14
+ Classifier: Operating System :: POSIX :: Linux
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3.5
17
+ Classifier: Programming Language :: Python :: 3.6
18
+ Classifier: Programming Language :: Python :: 3.7
19
+ Classifier: Topic :: System :: Shells
20
+ Classifier: Topic :: Terminals
21
+ Requires-Python: >=3.5
22
+ License-File: LICENSE
23
+ Requires-Dist: lxml
24
+ Requires-Dist: pyte
25
+ Requires-Dist: wcwidth
26
+ Requires-Dist: click
27
+ Requires-Dist: platformdirs
28
+ Requires-Dist: toml
29
+ Provides-Extra: dev
30
+ Requires-Dist: coverage; extra == "dev"
31
+ Requires-Dist: pylint; extra == "dev"
32
+ Requires-Dist: twine; extra == "dev"
33
+ Requires-Dist: wheel; extra == "dev"
34
+ Requires-Dist: pytest; extra == "dev"
35
+ Requires-Dist: pytest-cov; extra == "dev"
36
+ Requires-Dist: build; extra == "dev"
37
+ Dynamic: author
38
+ Dynamic: author-email
39
+ Dynamic: classifier
40
+ Dynamic: description
41
+ Dynamic: home-page
42
+ Dynamic: license
43
+ Dynamic: license-file
44
+ Dynamic: provides-extra
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
47
+ Dynamic: summary
48
+
49
+ A Linux terminal recorder written in Python which renders your command line sessions as standalone SVG animations.
@@ -0,0 +1,189 @@
1
+ # termcap - Terminal Capture Tool
2
+
3
+ *A modern Python package for recording terminal sessions as SVG animations, based on the original [termtosvg project](https://github.com/nbedos/termtosvg).*
4
+
5
+ ## Overview
6
+
7
+ termcap is a terminal session recorder that generates standalone SVG animations. This package is a modernized version of termtosvg with the following enhancements:
8
+
9
+ - 🎯 **Modern CLI Interface**: Based on `click` with intuitive subcommands
10
+ - ⚙️ **Configuration Management**: TOML-based configuration with `platformdirs`
11
+ - 🎨 **Template Management**: Easy installation and management of custom templates
12
+ - 🔧 **Enhanced User Experience**: Better error handling and user feedback
13
+
14
+ ## Installation
15
+
16
+ ```bash
17
+ pip install termcap
18
+ ```
19
+
20
+ ## Quick Start
21
+
22
+ ### Basic Recording
23
+
24
+ ```bash
25
+ # Record a terminal session
26
+ termcap record session.cast
27
+
28
+ # Render to SVG animation
29
+ termcap render session.cast animation.svg
30
+ ```
31
+
32
+ ### Using Templates
33
+
34
+ ```bash
35
+ # List available templates
36
+ termcap template list
37
+
38
+ # Use a specific template
39
+ termcap render session.cast animation.svg --template gjm8
40
+
41
+ # Install a custom template
42
+ termcap template install my_template template.svg
43
+ ```
44
+
45
+ ### Configuration Management
46
+
47
+ ```bash
48
+ # Show current configuration
49
+ termcap config show
50
+
51
+ # Set configuration values
52
+ termcap config set general default_template my_template
53
+ termcap config set general default_geometry 100x30
54
+
55
+ # Reset to defaults
56
+ termcap config reset
57
+ ```
58
+
59
+ ## Command Reference
60
+
61
+ ### Main Commands
62
+
63
+ - `termcap record [output.cast]` - Record a terminal session
64
+ - `termcap render input.cast [output.svg]` - Render cast file to SVG
65
+ - `termcap --version` - Show version information
66
+ - `termcap --help` - Show help message
67
+
68
+ ### Configuration Commands
69
+
70
+ - `termcap config show` - Display current configuration
71
+ - `termcap config set SECTION KEY VALUE` - Set configuration value
72
+ - `termcap config get SECTION KEY` - Get configuration value
73
+ - `termcap config reset` - Reset configuration to defaults
74
+ - `termcap config templates` - List available templates
75
+
76
+ ### Template Commands
77
+
78
+ - `termcap template list` - List all available templates
79
+ - `termcap template install NAME FILE` - Install custom template
80
+ - `termcap template remove NAME` - Remove custom template
81
+
82
+ ## Configuration
83
+
84
+ termcap uses a TOML configuration file located at:
85
+ - Linux: `~/.config/termcap/config.toml`
86
+ - macOS: `~/Library/Application Support/termcap/config.toml`
87
+ - Windows: `%APPDATA%\termcap\config.toml`
88
+
89
+ ### Default Configuration
90
+
91
+ ```toml
92
+ [general]
93
+ default_template = "gjm8"
94
+ default_geometry = "82x19"
95
+ default_min_duration = 17
96
+ default_max_duration = 3000
97
+ default_loop_delay = 1000
98
+
99
+ [templates]
100
+ custom_templates_enabled = true
101
+ builtin_templates_enabled = true
102
+
103
+ [output]
104
+ default_output_dir = "~/termcap_recordings"
105
+ auto_timestamp = true
106
+ ```
107
+
108
+ ## Templates
109
+
110
+ ### Built-in Templates
111
+
112
+ termcap includes several built-in templates:
113
+ - `gjm8` - Default colorful template
114
+ - `dracula` - Dark theme with purple accents
115
+ - `solarized_dark` / `solarized_light` - Solarized color schemes
116
+ - `ubuntu` - Ubuntu-styled terminal
117
+ - `putty` - PuTTY-like appearance
118
+ - `window_frame` - Terminal with window frame
119
+ - And more...
120
+
121
+ ### Custom Templates
122
+
123
+ Custom templates are stored in:
124
+ - Linux: `~/.config/termcap/templates/`
125
+ - macOS: `~/Library/Application Support/termcap/templates/`
126
+ - Windows: `%APPDATA%\termcap\templates\`
127
+
128
+ ## Migration from termtosvg
129
+
130
+ If you're migrating from termtosvg, termcap maintains backward compatibility:
131
+
132
+ ```bash
133
+ # These commands work the same way
134
+ termcap animation.svg
135
+ termcap record session.cast
136
+ termcap render session.cast animation.svg
137
+
138
+ # But you can also use the new modern interface
139
+ termcap record session.cast
140
+ termcap render session.cast animation.svg --template dracula
141
+ ```
142
+
143
+ ## Development
144
+
145
+ ### Requirements
146
+
147
+ - Python 3.5+
148
+ - click
149
+ - platformdirs
150
+ - toml
151
+ - lxml
152
+ - pyte
153
+ - wcwidth
154
+
155
+ ### Testing
156
+
157
+ ```bash
158
+ python -m pytest termcap/tests/
159
+ ```
160
+
161
+ ### Contributing
162
+
163
+ 1. Fork the repository
164
+ 2. Create a feature branch
165
+ 3. Make your changes
166
+ 4. Add tests
167
+ 5. Submit a pull request
168
+
169
+ ## License
170
+
171
+ BSD 3-clause license (same as original termtosvg)
172
+
173
+ ## Author
174
+
175
+ - **termcap**: rexwzh (1073853456@qq.com)
176
+ - **Original termtosvg**: Nicolas Bedos
177
+
178
+ ## Changelog
179
+
180
+ ### Version 0.1.0
181
+
182
+ - ✅ Rebranded as termcap
183
+ - ✅ Added click-based modern CLI interface
184
+ - ✅ Added TOML configuration management
185
+ - ✅ Added platformdirs for proper config directory handling
186
+ - ✅ Added template management commands
187
+ - ✅ Maintained full backward compatibility
188
+ - ✅ Improved error handling and user feedback
189
+ - ✅ 56 comprehensive tests ensure reliability
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env python3
2
+
3
+ import termcap.cli
4
+
5
+ if __name__ == '__main__':
6
+ termcap.cli.main()
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
termcap-0.1.0/setup.py ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env python
2
+
3
+ from setuptools import setup, find_packages
4
+
5
+ setup(
6
+ name='termcap',
7
+ version='0.1.0',
8
+ license='BSD 3-clause license',
9
+ author='rexwzh',
10
+ author_email='1073853456@qq.com',
11
+ description='Terminal capture tool - Record terminal sessions as SVG animations',
12
+ long_description='A Linux terminal recorder written in Python '
13
+ 'which renders your command line sessions as '
14
+ 'standalone SVG animations.',
15
+ url='https://github.com/rexwzh/termcap',
16
+ classifiers=[
17
+ 'Environment :: Console',
18
+ 'Intended Audience :: Developers',
19
+ 'License :: OSI Approved :: BSD License',
20
+ 'Operating System :: MacOS',
21
+ 'Operating System :: POSIX :: BSD',
22
+ 'Operating System :: POSIX :: Linux',
23
+ 'Programming Language :: Python',
24
+ 'Programming Language :: Python :: 3.5',
25
+ 'Programming Language :: Python :: 3.6',
26
+ 'Programming Language :: Python :: 3.7',
27
+ 'Topic :: System :: Shells',
28
+ 'Topic :: Terminals'
29
+ ],
30
+ python_requires='>=3.5',
31
+ packages=['termcap'], # 只包含 termcap 包
32
+ entry_points={
33
+ 'console_scripts': [
34
+ 'termcap=termcap.cli:main',
35
+ ],
36
+ },
37
+ include_package_data=True,
38
+ install_requires=[
39
+ 'lxml',
40
+ 'pyte',
41
+ 'wcwidth',
42
+ 'click',
43
+ 'platformdirs',
44
+ 'toml',
45
+ ],
46
+ extras_require={
47
+ 'dev': [
48
+ 'coverage',
49
+ 'pylint',
50
+ 'twine',
51
+ 'wheel',
52
+ 'pytest',
53
+ 'pytest-cov',
54
+ 'build',
55
+ ]
56
+ }
57
+ )
File without changes