TermuxC 2.2.3__tar.gz → 2.2.6__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.
- {termuxc-2.2.3/src/TermuxC.egg-info → termuxc-2.2.6}/PKG-INFO +12 -1
- {termuxc-2.2.3 → termuxc-2.2.6}/README.md +11 -0
- {termuxc-2.2.3 → termuxc-2.2.6}/pyproject.toml +1 -1
- {termuxc-2.2.3 → termuxc-2.2.6}/src/TermuxC/__init__.py +43 -5
- {termuxc-2.2.3 → termuxc-2.2.6/src/TermuxC.egg-info}/PKG-INFO +12 -1
- {termuxc-2.2.3 → termuxc-2.2.6}/LICENSE +0 -0
- {termuxc-2.2.3 → termuxc-2.2.6}/setup.cfg +0 -0
- {termuxc-2.2.3 → termuxc-2.2.6}/src/TermuxC.egg-info/SOURCES.txt +0 -0
- {termuxc-2.2.3 → termuxc-2.2.6}/src/TermuxC.egg-info/dependency_links.txt +0 -0
- {termuxc-2.2.3 → termuxc-2.2.6}/src/TermuxC.egg-info/entry_points.txt +0 -0
- {termuxc-2.2.3 → termuxc-2.2.6}/src/TermuxC.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TermuxC
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.6
|
|
4
4
|
Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
|
|
5
5
|
Author: Ruizennis
|
|
6
6
|
License: MIT
|
|
@@ -85,6 +85,17 @@ pip install TermuxC
|
|
|
85
85
|
```bash
|
|
86
86
|
pip uninstall TermuxC
|
|
87
87
|
```
|
|
88
|
+
## Flags
|
|
89
|
+
|Flag|Function |
|
|
90
|
+
|----|----------------|
|
|
91
|
+
| -f | Force file read|
|
|
92
|
+
| -t | Force Text copy|
|
|
93
|
+
| -h | Show help menu |
|
|
94
|
+
#### Aditional flag alliases
|
|
95
|
+
- --file
|
|
96
|
+
- --text
|
|
97
|
+
- --help
|
|
98
|
+
- -help
|
|
88
99
|
|
|
89
100
|
## Requirements:
|
|
90
101
|
**Python 3+**
|
|
@@ -67,6 +67,17 @@ pip install TermuxC
|
|
|
67
67
|
```bash
|
|
68
68
|
pip uninstall TermuxC
|
|
69
69
|
```
|
|
70
|
+
## Flags
|
|
71
|
+
|Flag|Function |
|
|
72
|
+
|----|----------------|
|
|
73
|
+
| -f | Force file read|
|
|
74
|
+
| -t | Force Text copy|
|
|
75
|
+
| -h | Show help menu |
|
|
76
|
+
#### Aditional flag alliases
|
|
77
|
+
- --file
|
|
78
|
+
- --text
|
|
79
|
+
- --help
|
|
80
|
+
- -help
|
|
70
81
|
|
|
71
82
|
## Requirements:
|
|
72
83
|
**Python 3+**
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "TermuxC"
|
|
7
|
-
version = "2.2.
|
|
7
|
+
version = "2.2.6"
|
|
8
8
|
description = "A lightweight utility to copy text to the device clipboard using OSC 52."
|
|
9
9
|
authors = [{name = "Ruizennis"}]
|
|
10
10
|
requires-python = ">=3.7"
|
|
@@ -9,7 +9,7 @@ from time import sleep
|
|
|
9
9
|
from threading import Lock
|
|
10
10
|
# configuration
|
|
11
11
|
Sleeptime = 0.5
|
|
12
|
-
|
|
12
|
+
helpflags = {'-h', '--help', '-help'}
|
|
13
13
|
help_message = '''
|
|
14
14
|
Usage:
|
|
15
15
|
|
|
@@ -38,7 +38,12 @@ from TermuxC import Copy
|
|
|
38
38
|
with open(filename, 'r') as F:
|
|
39
39
|
C = F.read()
|
|
40
40
|
Copy(C)
|
|
41
|
-
|
|
41
|
+
|
|
42
|
+
Flags
|
|
43
|
+
-f • Force File file
|
|
44
|
+
-t • Force text copy
|
|
45
|
+
-h • Show help menu
|
|
46
|
+
|
|
42
47
|
for more help see https://github.com/Ruizennis/TermuxC
|
|
43
48
|
'''
|
|
44
49
|
#New: added tmux support natively
|
|
@@ -51,7 +56,7 @@ def check_for_tmux():
|
|
|
51
56
|
|
|
52
57
|
lock = Lock()
|
|
53
58
|
|
|
54
|
-
def Copy(string):
|
|
59
|
+
def Copy(string: str | int) -> None:
|
|
55
60
|
with lock:
|
|
56
61
|
content = str(string)
|
|
57
62
|
b64 = base64.b64encode(content.encode('utf-8')).decode('ascii')
|
|
@@ -79,17 +84,50 @@ def main():
|
|
|
79
84
|
if not sys.stdin.isatty():
|
|
80
85
|
readstdin = sys.stdin.read()
|
|
81
86
|
if readstdin.endswith('\n'):
|
|
82
|
-
|
|
87
|
+
readstdin = readstdin[:-1]
|
|
88
|
+
if os.path.isfile(readstdin):
|
|
89
|
+
try:
|
|
90
|
+
with open(readstdin, 'r') as File:
|
|
91
|
+
readstdin = File.read()
|
|
92
|
+
except Exception as e:
|
|
93
|
+
print(f'Error reading file, {e}', file=sys.stderr)
|
|
94
|
+
sys.exit(1)
|
|
83
95
|
if readstdin:
|
|
84
96
|
Copy(readstdin)
|
|
85
97
|
sys.exit(0)
|
|
86
98
|
else:
|
|
87
99
|
print('Please provide an input', file=sys.stderr)
|
|
88
100
|
sys.exit(1)
|
|
89
|
-
elif
|
|
101
|
+
elif helpflags.intersection(sys.argv):
|
|
90
102
|
print(help_message)
|
|
91
103
|
sys.exit(0)
|
|
92
104
|
elif len(sys.argv) > 1:
|
|
105
|
+
if sys.argv[1] in ['-t', '--text']:
|
|
106
|
+
text = sys.stdin.read()
|
|
107
|
+
if text.endswith('\n'):
|
|
108
|
+
text = text[:-1]
|
|
109
|
+
Copy(text)
|
|
110
|
+
sys.exit(0)
|
|
111
|
+
|
|
112
|
+
elif sys.argv[1] in ['-f', '--file']:
|
|
113
|
+
if len(sys.argv) == 3:
|
|
114
|
+
file = sys.argv[2]
|
|
115
|
+
if os.path.isfile(file):
|
|
116
|
+
try:
|
|
117
|
+
with open(file, 'r') as filecopy:
|
|
118
|
+
Copy(filecopy.read())
|
|
119
|
+
except:
|
|
120
|
+
print('Error, failed to copy file.', file=sys.stderr)
|
|
121
|
+
else:
|
|
122
|
+
print('Error, invalid filepath', file=sys.stderr)
|
|
123
|
+
sys.exit(1)
|
|
124
|
+
|
|
125
|
+
else:
|
|
126
|
+
print('Error, -f flag requires a file', file=sys.stderr)
|
|
127
|
+
sys.exit(1)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
else:
|
|
93
131
|
Copy(' '.join(sys.argv[1:]))
|
|
94
132
|
sys.exit(0)
|
|
95
133
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TermuxC
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.6
|
|
4
4
|
Summary: A lightweight utility to copy text to the device clipboard using OSC 52.
|
|
5
5
|
Author: Ruizennis
|
|
6
6
|
License: MIT
|
|
@@ -85,6 +85,17 @@ pip install TermuxC
|
|
|
85
85
|
```bash
|
|
86
86
|
pip uninstall TermuxC
|
|
87
87
|
```
|
|
88
|
+
## Flags
|
|
89
|
+
|Flag|Function |
|
|
90
|
+
|----|----------------|
|
|
91
|
+
| -f | Force file read|
|
|
92
|
+
| -t | Force Text copy|
|
|
93
|
+
| -h | Show help menu |
|
|
94
|
+
#### Aditional flag alliases
|
|
95
|
+
- --file
|
|
96
|
+
- --text
|
|
97
|
+
- --help
|
|
98
|
+
- -help
|
|
88
99
|
|
|
89
100
|
## Requirements:
|
|
90
101
|
**Python 3+**
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|