meerschaum 2.2.6__py3-none-any.whl → 2.2.7__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.
- meerschaum/__main__.py +10 -5
- meerschaum/_internal/entry.py +13 -13
- meerschaum/_internal/shell/Shell.py +26 -22
- meerschaum/_internal/shell/updates.py +175 -0
- meerschaum/actions/register.py +19 -5
- meerschaum/actions/sync.py +3 -3
- meerschaum/actions/upgrade.py +28 -36
- meerschaum/api/routes/_pipes.py +20 -20
- meerschaum/config/_formatting.py +1 -0
- meerschaum/config/_paths.py +4 -0
- meerschaum/config/_shell.py +78 -66
- meerschaum/config/_version.py +1 -1
- meerschaum/config/static/__init__.py +1 -0
- meerschaum/connectors/api/_misc.py +1 -1
- meerschaum/connectors/api/_request.py +13 -9
- meerschaum/core/Pipe/_sync.py +3 -0
- meerschaum/utils/daemon/Daemon.py +88 -129
- meerschaum/utils/daemon/FileDescriptorInterceptor.py +14 -5
- meerschaum/utils/daemon/RotatingFile.py +8 -1
- meerschaum/utils/daemon/__init__.py +28 -21
- meerschaum/utils/formatting/__init__.py +81 -36
- meerschaum/utils/formatting/_jobs.py +47 -9
- meerschaum/utils/packages/__init__.py +21 -15
- meerschaum/utils/prompt.py +5 -0
- meerschaum/utils/schedule.py +21 -15
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/METADATA +1 -1
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/RECORD +33 -32
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/LICENSE +0 -0
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/NOTICE +0 -0
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/WHEEL +0 -0
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/entry_points.txt +0 -0
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/top_level.txt +0 -0
- {meerschaum-2.2.6.dist-info → meerschaum-2.2.7.dist-info}/zip-safe +0 -0
meerschaum/config/_shell.py
CHANGED
@@ -6,127 +6,139 @@
|
|
6
6
|
Default configuration for the Meerschaum shell.
|
7
7
|
"""
|
8
8
|
|
9
|
-
# import platform
|
10
|
-
# default_cmd = 'cmd' if platform.system() != 'Windows' else 'cmd2'
|
11
9
|
default_cmd = 'cmd'
|
12
10
|
|
13
11
|
default_shell_config = {
|
14
|
-
'ansi'
|
15
|
-
'intro'
|
16
|
-
'rich'
|
17
|
-
'style'
|
12
|
+
'ansi' : {
|
13
|
+
'intro' : {
|
14
|
+
'rich' : {
|
15
|
+
'style' : "bold bright_blue",
|
18
16
|
},
|
19
|
-
'color'
|
17
|
+
'color' : [
|
20
18
|
'bold',
|
21
19
|
'bright blue',
|
22
20
|
],
|
23
21
|
},
|
24
|
-
'close_message': {
|
25
|
-
'rich'
|
26
|
-
'style'
|
22
|
+
'close_message' : {
|
23
|
+
'rich' : {
|
24
|
+
'style' : 'bright_blue',
|
27
25
|
},
|
28
|
-
'color'
|
26
|
+
'color' : [
|
29
27
|
'bright blue',
|
30
28
|
],
|
31
29
|
},
|
32
|
-
'doc_header': {
|
33
|
-
'rich'
|
34
|
-
'style'
|
30
|
+
'doc_header' : {
|
31
|
+
'rich' : {
|
32
|
+
'style' : 'bright_blue',
|
35
33
|
},
|
36
|
-
'color'
|
34
|
+
'color' : [
|
37
35
|
'bright blue',
|
38
36
|
],
|
39
37
|
},
|
40
|
-
'undoc_header': {
|
41
|
-
'rich'
|
42
|
-
'style'
|
38
|
+
'undoc_header' : {
|
39
|
+
'rich' : {
|
40
|
+
'style' : 'bright_blue',
|
43
41
|
},
|
44
|
-
'color'
|
42
|
+
'color' : [
|
45
43
|
'bright blue',
|
46
44
|
],
|
47
45
|
},
|
48
|
-
'ruler': {
|
49
|
-
'rich'
|
50
|
-
'style'
|
46
|
+
'ruler' : {
|
47
|
+
'rich' : {
|
48
|
+
'style' : 'bold bright_blue',
|
51
49
|
},
|
52
|
-
'color'
|
50
|
+
'color' : [
|
53
51
|
'bold',
|
54
52
|
'bright blue',
|
55
53
|
],
|
56
54
|
},
|
57
|
-
'prompt': {
|
58
|
-
'rich'
|
59
|
-
'style'
|
55
|
+
'prompt' : {
|
56
|
+
'rich' : {
|
57
|
+
'style' : 'green',
|
60
58
|
},
|
61
|
-
'color'
|
59
|
+
'color' : [
|
62
60
|
'green',
|
63
61
|
],
|
64
62
|
},
|
65
|
-
'instance'
|
66
|
-
'rich'
|
67
|
-
'style'
|
63
|
+
'instance' : {
|
64
|
+
'rich' : {
|
65
|
+
'style' : 'cyan',
|
68
66
|
},
|
69
|
-
'color'
|
67
|
+
'color' : [
|
70
68
|
'cyan',
|
71
69
|
],
|
72
70
|
},
|
73
|
-
'repo'
|
74
|
-
'rich': {
|
75
|
-
'style': 'magenta',
|
71
|
+
'repo' : {
|
72
|
+
'rich' : {
|
73
|
+
'style' : 'magenta',
|
76
74
|
},
|
77
|
-
'color': [
|
75
|
+
'color' : [
|
78
76
|
'magenta',
|
79
77
|
],
|
80
78
|
},
|
81
|
-
'username'
|
82
|
-
'rich'
|
83
|
-
'style'
|
79
|
+
'username' : {
|
80
|
+
'rich' : {
|
81
|
+
'style' : 'white',
|
84
82
|
},
|
85
|
-
'color'
|
83
|
+
'color' : [
|
86
84
|
'white',
|
87
85
|
],
|
88
86
|
},
|
89
|
-
'connected'
|
90
|
-
'rich'
|
91
|
-
'style'
|
87
|
+
'connected' : {
|
88
|
+
'rich' : {
|
89
|
+
'style' : 'green',
|
92
90
|
},
|
93
|
-
'color'
|
91
|
+
'color' : [
|
94
92
|
'green',
|
95
93
|
],
|
96
94
|
},
|
97
|
-
'disconnected'
|
98
|
-
'rich'
|
99
|
-
'style'
|
95
|
+
'disconnected' : {
|
96
|
+
'rich' : {
|
97
|
+
'style' : 'red',
|
100
98
|
},
|
101
|
-
'color'
|
99
|
+
'color' : [
|
100
|
+
'red',
|
101
|
+
],
|
102
|
+
},
|
103
|
+
'update_message' : {
|
104
|
+
'rich' : {
|
105
|
+
'style' : 'red',
|
106
|
+
},
|
107
|
+
'color' : [
|
102
108
|
'red',
|
103
109
|
],
|
104
110
|
},
|
105
111
|
},
|
106
|
-
'ascii'
|
107
|
-
'intro'
|
112
|
+
'ascii' : {
|
113
|
+
'intro' : r""" ___ ___ __ __ __
|
108
114
|
|\/| |__ |__ |__) /__` / ` |__| /\ | | |\/|
|
109
115
|
| | |___ |___ | \ .__/ \__, | | /~~\ \__/ | |\n""",
|
110
|
-
'prompt'
|
111
|
-
'ruler'
|
112
|
-
'close_message': 'Thank you for using Meerschaum!',
|
113
|
-
'doc_header'
|
114
|
-
'undoc_header'
|
116
|
+
'prompt' : '\n [ {username}@{instance} ] > ',
|
117
|
+
'ruler' : '-',
|
118
|
+
'close_message' : 'Thank you for using Meerschaum!',
|
119
|
+
'doc_header' : 'Meerschaum actions (`help <action>` for usage):',
|
120
|
+
'undoc_header' : 'Unimplemented actions:',
|
121
|
+
'update_message' : "Update available!",
|
115
122
|
},
|
116
|
-
'unicode'
|
117
|
-
'intro'
|
123
|
+
'unicode' : {
|
124
|
+
'intro' : """
|
118
125
|
█▄ ▄█ ██▀ ██▀ █▀▄ ▄▀▀ ▄▀▀ █▄█ ▄▀▄ █ █ █▄ ▄█
|
119
126
|
█ ▀ █ █▄▄ █▄▄ █▀▄ ▄██ ▀▄▄ █ █ █▀█ ▀▄█ █ ▀ █\n""",
|
120
|
-
'prompt'
|
121
|
-
'ruler'
|
122
|
-
'close_message': ' MRSM{formatting:emoji:hand} Thank you for using Meerschaum! ',
|
123
|
-
'doc_header'
|
124
|
-
'undoc_header'
|
127
|
+
'prompt' : '\n [ {username}@{instance} ] ➤ ',
|
128
|
+
'ruler' : '─',
|
129
|
+
'close_message' : ' MRSM{formatting:emoji:hand} Thank you for using Meerschaum! ',
|
130
|
+
'doc_header' : 'Meerschaum actions (`help <action>` for usage):',
|
131
|
+
'undoc_header' : 'Unimplemented actions:',
|
132
|
+
'update_message' : "MRSM{formatting:emoji:announcement} Update available!",
|
133
|
+
},
|
134
|
+
'timeout' : 60,
|
135
|
+
'max_history' : 1000,
|
136
|
+
'clear_screen' : True,
|
137
|
+
'bottom_toolbar' : {
|
138
|
+
'enabled' : True,
|
125
139
|
},
|
126
|
-
'
|
127
|
-
|
128
|
-
|
129
|
-
'bottom_toolbar' : {
|
130
|
-
'enabled' : True,
|
140
|
+
'updates' : {
|
141
|
+
'check_remote' : True,
|
142
|
+
'refresh_minutes': 180,
|
131
143
|
},
|
132
144
|
}
|
meerschaum/config/_version.py
CHANGED
@@ -11,7 +11,7 @@ import urllib.parse
|
|
11
11
|
import pathlib
|
12
12
|
from meerschaum.utils.typing import Any, Optional, Dict, Union
|
13
13
|
from meerschaum.utils.debug import dprint
|
14
|
-
from meerschaum.
|
14
|
+
from meerschaum.config.static import STATIC_CONFIG
|
15
15
|
|
16
16
|
METHODS = {
|
17
17
|
'GET',
|
@@ -23,15 +23,16 @@ METHODS = {
|
|
23
23
|
'DELETE',
|
24
24
|
}
|
25
25
|
|
26
|
+
|
26
27
|
def make_request(
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
28
|
+
self,
|
29
|
+
method: str,
|
30
|
+
r_url: str,
|
31
|
+
headers: Optional[Dict[str, Any]] = None,
|
32
|
+
use_token: bool = True,
|
33
|
+
debug: bool = False,
|
34
|
+
**kwargs: Any
|
35
|
+
) -> 'requests.Response':
|
35
36
|
"""
|
36
37
|
Make a request to this APIConnector's endpoint using the in-memory session.
|
37
38
|
|
@@ -84,6 +85,9 @@ def make_request(
|
|
84
85
|
if use_token:
|
85
86
|
headers.update({'Authorization': f'Bearer {self.token}'})
|
86
87
|
|
88
|
+
if 'timeout' not in kwargs:
|
89
|
+
kwargs['timeout'] = STATIC_CONFIG['api']['default_timeout']
|
90
|
+
|
87
91
|
request_url = urllib.parse.urljoin(self.url, r_url)
|
88
92
|
if debug:
|
89
93
|
dprint(f"[{self}] Sending a '{method.upper()}' request to {request_url}")
|
meerschaum/core/Pipe/_sync.py
CHANGED
@@ -194,6 +194,9 @@ def sync(
|
|
194
194
|
if hasattr(df, 'MRSM_INFER_FETCH'):
|
195
195
|
try:
|
196
196
|
if p.connector is None:
|
197
|
+
if ':' not in p.connector_keys:
|
198
|
+
return True, f"{p} does not support fetching; nothing to do."
|
199
|
+
|
197
200
|
msg = f"{p} does not have a valid connector."
|
198
201
|
if p.connector_keys.startswith('plugin:'):
|
199
202
|
msg += f"\n Perhaps {p.connector_keys} has a syntax error?"
|