TermuxC 2.0.0__py3-none-any.whl

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.
TermuxC/__init__.py ADDED
@@ -0,0 +1,72 @@
1
+ # TermuxC aka Termux copy, view README.md for more info
2
+ # Copyright (c) 2026 Ruizennis
3
+ # This software is licensed under the MIT License.
4
+ # See the root LICENSE file or https://opensource.org/licenses/MIT for full terms.
5
+ import base64
6
+ import sys
7
+ from time import sleep
8
+ from threading import Lock
9
+ # configuration
10
+ Sleeptime = 0.5
11
+ help = {'-h', '--help', '-help'}
12
+ help_message = '''
13
+ Usage:
14
+
15
+ Copying text with cli
16
+ termuxc Test!
17
+ OR
18
+ echo "test" | Termuxc
19
+
20
+ Copying a number with cli
21
+ termuxc 1
22
+
23
+ Copying filecontents with cli
24
+ cat Filename | Termuxc
25
+ (replace filename with desired file path)
26
+
27
+ Using pip package to copy text
28
+ from TermuxC import Copy
29
+ Copy('test')
30
+
31
+ Using pip package to copy number
32
+ from TermuxC import Copy
33
+ Copy(1)
34
+
35
+ Using Pip package to text copy from file
36
+ from TermuxC import Copy
37
+ with open(filename, 'r') as F:
38
+ C = F.read()
39
+ Copy(C)
40
+
41
+ for more help see https://github.com/Ruizennis/TermuxC
42
+ '''
43
+ lock = Lock()
44
+
45
+ def Copy(string):
46
+ with lock:
47
+ content = str(string)
48
+ b64 = base64.b64encode(content.encode('utf-8')).decode('ascii')
49
+ sys.stdout.write(f"\033]52;c;{b64}\a")
50
+ sys.stdout.flush()
51
+ sleep(Sleeptime)
52
+
53
+ def main():
54
+ if not sys.stdin.isatty():
55
+ readstdin = sys.stdin.read()
56
+ if readstdin.endswith('\n'):
57
+ readstdin = readstdin[:-1]
58
+ if readstdin:
59
+ Copy(readstdin)
60
+ sys.exit(0)
61
+ else:
62
+ print('Please provide an input')
63
+ sys.exit(0)
64
+ elif help.intersection(sys.argv):
65
+ print(help_message)
66
+ sys.exit(0)
67
+ elif len(sys.argv) > 1:
68
+ Copy(' '.join(sys.argv[1:]))
69
+ sys.exit(0)
70
+ else:
71
+ print('Please provide atleast 1 argument or run termuxc --help for help.')
72
+ sys.exit(0)
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: TermuxC
3
+ Version: 2.0.0
4
+ Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
5
+ Author: Ruizennis
6
+ License-File: LICENSE
7
+ Dynamic: license-file
@@ -0,0 +1,7 @@
1
+ TermuxC/__init__.py,sha256=EuY9ReBewxnZe5G5IGr4NAR-g_VkK9hXO5VxmlO-TZk,1722
2
+ termuxc-2.0.0.dist-info/licenses/LICENSE,sha256=ECXjQ6V9w90jlEzryWrBI39iu7wjV2ea0da2laoo4Zg,1065
3
+ termuxc-2.0.0.dist-info/METADATA,sha256=FL6cMEyu6kFs0Y6vsdQHhLoDq_90bgGFMpKdYaR6FKI,195
4
+ termuxc-2.0.0.dist-info/WHEEL,sha256=K260EYznzXsJYBQGqmI8VTxEdiZYNvDZwW9cBh9-_MA,91
5
+ termuxc-2.0.0.dist-info/entry_points.txt,sha256=zxZEbwBt8Rusq_8szLVg4YMHYJ8LexBRu0uBYlR0Vos,64
6
+ termuxc-2.0.0.dist-info/top_level.txt,sha256=CbyhkJByg46QCWGoF_Mu9H4ReiMWXjb20fjB2j90hdE,8
7
+ termuxc-2.0.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (83.0.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ Termuxc = TermuxC:main
3
+ termuxc = TermuxC:main
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Ruizennis
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1 @@
1
+ TermuxC