meerschaum 2.2.5.dev3__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/__init__.py +4 -1
- meerschaum/__main__.py +10 -5
- meerschaum/_internal/arguments/_parser.py +13 -2
- meerschaum/_internal/docs/index.py +523 -26
- meerschaum/_internal/entry.py +13 -13
- meerschaum/_internal/shell/Shell.py +26 -22
- meerschaum/_internal/shell/updates.py +175 -0
- meerschaum/_internal/term/__init__.py +2 -2
- meerschaum/actions/bootstrap.py +13 -14
- meerschaum/actions/python.py +11 -8
- meerschaum/actions/register.py +149 -37
- meerschaum/actions/show.py +79 -71
- meerschaum/actions/stop.py +11 -11
- meerschaum/actions/sync.py +3 -3
- meerschaum/actions/upgrade.py +28 -36
- meerschaum/api/dash/callbacks/login.py +21 -13
- meerschaum/api/dash/pages/login.py +2 -2
- meerschaum/api/routes/_login.py +5 -5
- meerschaum/api/routes/_pipes.py +20 -20
- meerschaum/config/__init__.py +8 -1
- meerschaum/config/_formatting.py +1 -0
- meerschaum/config/_paths.py +24 -2
- meerschaum/config/_shell.py +78 -66
- meerschaum/config/_version.py +1 -1
- meerschaum/config/paths.py +21 -2
- meerschaum/config/static/__init__.py +2 -0
- meerschaum/connectors/Connector.py +7 -2
- meerschaum/connectors/__init__.py +7 -5
- meerschaum/connectors/api/APIConnector.py +7 -2
- meerschaum/connectors/api/_actions.py +23 -31
- meerschaum/connectors/api/_misc.py +1 -1
- meerschaum/connectors/api/_request.py +13 -9
- meerschaum/connectors/api/_uri.py +5 -5
- meerschaum/core/Pipe/__init__.py +7 -3
- meerschaum/core/Pipe/_data.py +23 -15
- meerschaum/core/Pipe/_deduplicate.py +1 -1
- meerschaum/core/Pipe/_dtypes.py +5 -0
- meerschaum/core/Pipe/_fetch.py +18 -16
- meerschaum/core/Pipe/_sync.py +23 -15
- meerschaum/plugins/_Plugin.py +6 -6
- meerschaum/plugins/__init__.py +1 -1
- meerschaum/utils/daemon/Daemon.py +88 -129
- meerschaum/utils/daemon/FileDescriptorInterceptor.py +14 -5
- meerschaum/utils/daemon/RotatingFile.py +23 -17
- meerschaum/utils/daemon/__init__.py +28 -21
- meerschaum/utils/dataframe.py +12 -4
- meerschaum/utils/debug.py +9 -15
- meerschaum/utils/formatting/__init__.py +92 -46
- meerschaum/utils/formatting/_jobs.py +47 -9
- meerschaum/utils/misc.py +117 -11
- meerschaum/utils/packages/__init__.py +28 -16
- meerschaum/utils/prompt.py +5 -0
- meerschaum/utils/schedule.py +21 -15
- meerschaum/utils/typing.py +1 -0
- meerschaum/utils/venv/__init__.py +5 -1
- meerschaum/utils/warnings.py +8 -1
- meerschaum/utils/yaml.py +2 -2
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/METADATA +1 -1
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/RECORD +65 -64
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/WHEEL +1 -1
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/LICENSE +0 -0
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/NOTICE +0 -0
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/entry_points.txt +0 -0
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/top_level.txt +0 -0
- {meerschaum-2.2.5.dev3.dist-info → meerschaum-2.2.7.dist-info}/zip-safe +0 -0
meerschaum/actions/show.py
CHANGED
@@ -48,9 +48,9 @@ def show(
|
|
48
48
|
|
49
49
|
|
50
50
|
def _complete_show(
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
action: Optional[List[str]] = None,
|
52
|
+
**kw: Any
|
53
|
+
) -> List[str]:
|
54
54
|
"""
|
55
55
|
Override the default Meerschaum `complete_` function.
|
56
56
|
"""
|
@@ -91,7 +91,13 @@ def _show_actions(**kw: Any) -> SuccessTuple:
|
|
91
91
|
from meerschaum.utils.misc import print_options
|
92
92
|
from meerschaum._internal.shell.Shell import hidden_commands
|
93
93
|
_actions = [ _a for _a in actions if _a not in hidden_commands ]
|
94
|
-
print_options(
|
94
|
+
print_options(
|
95
|
+
options=_actions,
|
96
|
+
name='actions',
|
97
|
+
actions=False,
|
98
|
+
sort_options=True,
|
99
|
+
**kw
|
100
|
+
)
|
95
101
|
return True, "Success"
|
96
102
|
|
97
103
|
|
@@ -247,16 +253,16 @@ def _show_connectors(
|
|
247
253
|
|
248
254
|
|
249
255
|
def _complete_show_connectors(
|
250
|
-
|
251
|
-
|
256
|
+
action: Optional[List[str]] = None, **kw: Any
|
257
|
+
) -> List[str]:
|
252
258
|
from meerschaum.utils.misc import get_connector_labels
|
253
259
|
_text = action[0] if action else ""
|
254
260
|
return get_connector_labels(search_term=_text, ignore_exact_match=True)
|
255
261
|
|
256
262
|
|
257
263
|
def _show_arguments(
|
258
|
-
|
259
|
-
|
264
|
+
**kw: Any
|
265
|
+
) -> SuccessTuple:
|
260
266
|
"""
|
261
267
|
Show the parsed keyword arguments.
|
262
268
|
"""
|
@@ -266,16 +272,16 @@ def _show_arguments(
|
|
266
272
|
|
267
273
|
|
268
274
|
def _show_data(
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
275
|
+
action: Optional[List[str]] = None,
|
276
|
+
gui: bool = False,
|
277
|
+
begin: Optional[datetime.datetime] = None,
|
278
|
+
end: Optional[datetime.datetime] = None,
|
279
|
+
params: Optional[Dict[str, Any]] = None,
|
280
|
+
chunksize: Optional[int] = -1,
|
281
|
+
nopretty: bool = False,
|
282
|
+
debug: bool = False,
|
283
|
+
**kw: Any
|
284
|
+
) -> SuccessTuple:
|
279
285
|
"""
|
280
286
|
Show pipes data as Pandas DataFrames.
|
281
287
|
|
@@ -374,11 +380,11 @@ def _show_data(
|
|
374
380
|
|
375
381
|
|
376
382
|
def _show_columns(
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
383
|
+
action: Optional[List[str]] = None,
|
384
|
+
debug: bool = False,
|
385
|
+
nopretty: bool = False,
|
386
|
+
**kw: Any
|
387
|
+
) -> SuccessTuple:
|
382
388
|
"""
|
383
389
|
Show the registered and table columns for pipes.
|
384
390
|
"""
|
@@ -392,11 +398,11 @@ def _show_columns(
|
|
392
398
|
|
393
399
|
|
394
400
|
def _show_rowcounts(
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
401
|
+
action: Optional[List[str]] = None,
|
402
|
+
workers: Optional[int] = None,
|
403
|
+
debug: bool = False,
|
404
|
+
**kw: Any
|
405
|
+
) -> SuccessTuple:
|
400
406
|
"""
|
401
407
|
Show the rowcounts for pipes.
|
402
408
|
|
@@ -433,12 +439,12 @@ def _show_rowcounts(
|
|
433
439
|
return True, "Success"
|
434
440
|
|
435
441
|
def _show_plugins(
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
+
action: Optional[List[str]] = None,
|
443
|
+
repository: Optional[str] = None,
|
444
|
+
nopretty: bool = False,
|
445
|
+
debug: bool = False,
|
446
|
+
**kw: Any
|
447
|
+
) -> SuccessTuple:
|
442
448
|
"""
|
443
449
|
Show the installed plugins.
|
444
450
|
"""
|
@@ -475,10 +481,10 @@ def _show_plugins(
|
|
475
481
|
return True, "Success"
|
476
482
|
|
477
483
|
def _show_users(
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
484
|
+
mrsm_instance: Optional[str] = None,
|
485
|
+
debug: bool = False,
|
486
|
+
**kw: Any
|
487
|
+
) -> SuccessTuple:
|
482
488
|
"""
|
483
489
|
Show the registered users in a Meerschaum instance (default is the current instance).
|
484
490
|
"""
|
@@ -498,10 +504,10 @@ def _show_users(
|
|
498
504
|
return True, "Success"
|
499
505
|
|
500
506
|
def _show_packages(
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
507
|
+
action: Optional[List[str]] = None,
|
508
|
+
nopretty: bool = False,
|
509
|
+
**kw: Any
|
510
|
+
) -> SuccessTuple:
|
505
511
|
"""
|
506
512
|
Show the packages in dependency groups, or as a list with `--nopretty`.
|
507
513
|
"""
|
@@ -530,9 +536,9 @@ def _show_packages(
|
|
530
536
|
return True, "Success"
|
531
537
|
|
532
538
|
def _complete_show_packages(
|
533
|
-
|
534
|
-
|
535
|
-
|
539
|
+
action: Optional[List[str]] = None,
|
540
|
+
**kw: Any
|
541
|
+
) -> List[str]:
|
536
542
|
from meerschaum.utils.packages import packages
|
537
543
|
if not action:
|
538
544
|
return sorted(list(packages.keys()))
|
@@ -545,10 +551,10 @@ def _complete_show_packages(
|
|
545
551
|
return possibilities
|
546
552
|
|
547
553
|
def _show_jobs(
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
554
|
+
action: Optional[List[str]] = None,
|
555
|
+
nopretty: bool = False,
|
556
|
+
**kw: Any
|
557
|
+
) -> SuccessTuple:
|
552
558
|
"""
|
553
559
|
Show the currently running and stopped jobs.
|
554
560
|
"""
|
@@ -572,10 +578,10 @@ def _show_jobs(
|
|
572
578
|
|
573
579
|
|
574
580
|
def _show_logs(
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
581
|
+
action: Optional[List[str]] = None,
|
582
|
+
nopretty: bool = False,
|
583
|
+
**kw
|
584
|
+
) -> SuccessTuple:
|
579
585
|
"""
|
580
586
|
Show the logs for jobs.
|
581
587
|
|
@@ -607,13 +613,15 @@ def _show_logs(
|
|
607
613
|
now_follow_str = now.strftime(follow_timestamp_format)
|
608
614
|
|
609
615
|
def build_buffer_spaces(daemons) -> Dict[str, str]:
|
610
|
-
max_len_id =
|
616
|
+
max_len_id = (
|
617
|
+
max(len(d.daemon_id) for d in daemons) + 1
|
618
|
+
) if daemons else 0
|
611
619
|
buffer_len = max(
|
612
620
|
get_config('jobs', 'logs', 'min_buffer_len'),
|
613
|
-
max_len_id
|
621
|
+
max_len_id
|
614
622
|
)
|
615
623
|
return {
|
616
|
-
d.daemon_id: ''.join([' '
|
624
|
+
d.daemon_id: ''.join([' '] * (buffer_len - len(d.daemon_id)))
|
617
625
|
for d in daemons
|
618
626
|
}
|
619
627
|
|
@@ -763,9 +771,9 @@ def _show_logs(
|
|
763
771
|
|
764
772
|
|
765
773
|
def _show_environment(
|
766
|
-
|
767
|
-
|
768
|
-
|
774
|
+
nopretty: bool = False,
|
775
|
+
**kw
|
776
|
+
) -> SuccessTuple:
|
769
777
|
"""
|
770
778
|
Show all of the current environment variables with begin with `'MRSM_'`.
|
771
779
|
"""
|
@@ -783,12 +791,12 @@ def _show_environment(
|
|
783
791
|
|
784
792
|
|
785
793
|
def _show_tags(
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
794
|
+
action: Optional[List[str]] = None,
|
795
|
+
tags: Optional[List[str]] = None,
|
796
|
+
workers: Optional[int] = None,
|
797
|
+
nopretty: bool = False,
|
798
|
+
**kwargs
|
799
|
+
) -> SuccessTuple:
|
792
800
|
"""
|
793
801
|
Show the existing tags and their associated pipes.
|
794
802
|
"""
|
@@ -863,10 +871,10 @@ def _show_tags(
|
|
863
871
|
|
864
872
|
|
865
873
|
def _show_schedules(
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
874
|
+
action: Optional[List[str]] = None,
|
875
|
+
nopretty: bool = False,
|
876
|
+
**kwargs: Any
|
877
|
+
) -> SuccessTuple:
|
870
878
|
"""
|
871
879
|
Print the upcoming timestamps according to the given schedule.
|
872
880
|
|
@@ -914,8 +922,8 @@ def _show_schedules(
|
|
914
922
|
|
915
923
|
|
916
924
|
def _show_venvs(
|
917
|
-
|
918
|
-
|
925
|
+
**kwargs: Any
|
926
|
+
):
|
919
927
|
"""
|
920
928
|
Print the available virtual environments in the current MRSM_ROOT_DIR.
|
921
929
|
"""
|
meerschaum/actions/stop.py
CHANGED
@@ -21,9 +21,9 @@ def stop(action: Optional[List[str]] = None, **kw) -> SuccessTuple:
|
|
21
21
|
|
22
22
|
|
23
23
|
def _complete_stop(
|
24
|
-
|
25
|
-
|
26
|
-
|
24
|
+
action: Optional[List[str]] = None,
|
25
|
+
**kw: Any
|
26
|
+
) -> List[str]:
|
27
27
|
"""
|
28
28
|
Override the default Meerschaum `complete_` function.
|
29
29
|
"""
|
@@ -49,14 +49,14 @@ def _complete_stop(
|
|
49
49
|
|
50
50
|
|
51
51
|
def _stop_jobs(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
52
|
+
action: Optional[List[str]] = None,
|
53
|
+
timeout_seconds: Optional[int] = None,
|
54
|
+
noask: bool = False,
|
55
|
+
force: bool = False,
|
56
|
+
yes: bool = False,
|
57
|
+
nopretty: bool = False,
|
58
|
+
**kw
|
59
|
+
) -> SuccessTuple:
|
60
60
|
"""
|
61
61
|
Stop running jobs that were started with `-d` or `start job`.
|
62
62
|
|
meerschaum/actions/sync.py
CHANGED
@@ -14,9 +14,9 @@ import meerschaum as mrsm
|
|
14
14
|
from meerschaum.utils.typing import SuccessTuple, Any, List, Optional, Tuple, Union
|
15
15
|
|
16
16
|
def sync(
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
action: Optional[List[str]] = None,
|
18
|
+
**kw: Any
|
19
|
+
) -> SuccessTuple:
|
20
20
|
"""
|
21
21
|
Fetch and sync data for pipes.
|
22
22
|
|
meerschaum/actions/upgrade.py
CHANGED
@@ -10,9 +10,9 @@ from __future__ import annotations
|
|
10
10
|
from meerschaum.utils.typing import SuccessTuple, Any, List, Optional, Union
|
11
11
|
|
12
12
|
def upgrade(
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
action: Optional[List[str]] = None,
|
14
|
+
**kw: Any
|
15
|
+
) -> SuccessTuple:
|
16
16
|
"""
|
17
17
|
Upgrade Meerschaum, plugins, or packages.
|
18
18
|
|
@@ -34,13 +34,13 @@ def upgrade(
|
|
34
34
|
|
35
35
|
|
36
36
|
def _upgrade_meerschaum(
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
37
|
+
action: Optional[List[str]] = None,
|
38
|
+
yes: bool = False,
|
39
|
+
force: bool = False,
|
40
|
+
noask: bool = False,
|
41
|
+
debug: bool = False,
|
42
|
+
**kw: Any
|
43
|
+
) -> SuccessTuple:
|
44
44
|
"""
|
45
45
|
Upgrade the current Meerschaum instance.
|
46
46
|
Optionally specify dependency groups.
|
@@ -109,26 +109,21 @@ class NoVenv:
|
|
109
109
|
pass
|
110
110
|
|
111
111
|
def _upgrade_packages(
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
112
|
+
action: Optional[List[str]] = None,
|
113
|
+
venv: Union[str, None, NoVenv] = NoVenv,
|
114
|
+
yes: bool = False,
|
115
|
+
force: bool = False,
|
116
|
+
noask: bool = False,
|
117
|
+
debug: bool = False,
|
118
|
+
**kw: Any
|
119
|
+
) -> SuccessTuple:
|
120
120
|
"""
|
121
121
|
Upgrade and install dependencies.
|
122
122
|
If provided, upgrade only a dependency group, otherwise default to `full`.
|
123
123
|
|
124
124
|
Examples:
|
125
|
-
```
|
126
125
|
upgrade packages
|
127
|
-
|
128
|
-
|
129
|
-
```
|
130
|
-
upgrade packages docs
|
131
|
-
```
|
126
|
+
upgrade packages full
|
132
127
|
"""
|
133
128
|
from meerschaum.utils.packages import packages, pip_install, get_prerelease_dependencies
|
134
129
|
from meerschaum.utils.warnings import info, warn
|
@@ -178,14 +173,15 @@ def _upgrade_packages(
|
|
178
173
|
)
|
179
174
|
return success, msg
|
180
175
|
|
176
|
+
|
181
177
|
def _upgrade_plugins(
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
178
|
+
action: Optional[List[str]] = None,
|
179
|
+
yes: bool = False,
|
180
|
+
force: bool = False,
|
181
|
+
noask: bool = False,
|
182
|
+
debug: bool = False,
|
183
|
+
**kw: Any
|
184
|
+
) -> SuccessTuple:
|
189
185
|
"""
|
190
186
|
Upgrade all installed plugins to the latest versions.
|
191
187
|
If no plugins are specified, attempt to upgrade all,
|
@@ -193,12 +189,8 @@ def _upgrade_plugins(
|
|
193
189
|
|
194
190
|
Examples:
|
195
191
|
|
196
|
-
```
|
197
192
|
upgrade plugins
|
198
|
-
|
199
|
-
```
|
200
|
-
upgrade plugins testing
|
201
|
-
```
|
193
|
+
upgrade plugins noaa
|
202
194
|
"""
|
203
195
|
from meerschaum.actions import actions
|
204
196
|
from meerschaum.plugins import get_plugins_names
|
@@ -17,6 +17,7 @@ from dash.dependencies import Input, Output, State
|
|
17
17
|
from meerschaum.api.dash import dash_app, debug, pipes, _get_pipes, active_sessions
|
18
18
|
from meerschaum.api.dash.connectors import get_web_connector
|
19
19
|
from meerschaum.api.routes._login import login
|
20
|
+
from meerschaum.api.dash.components import alert_from_success_tuple
|
20
21
|
from fastapi_login.exceptions import InvalidCredentialsException
|
21
22
|
from fastapi.exceptions import HTTPException
|
22
23
|
dbc = attempt_import('dash_bootstrap_components', lazy=False, check_update=CHECK_UPDATE)
|
@@ -39,6 +40,7 @@ def show_registration_disabled_collapse(n_clicks, is_open):
|
|
39
40
|
Output('session-store', 'data'),
|
40
41
|
Output('username-input', 'className'),
|
41
42
|
Output('location', 'pathname'),
|
43
|
+
Output('login-alert-div', 'children'),
|
42
44
|
Input('username-input', 'n_submit'),
|
43
45
|
Input('password-input', 'n_submit'),
|
44
46
|
Input('login-button', 'n_clicks'),
|
@@ -48,14 +50,14 @@ def show_registration_disabled_collapse(n_clicks, is_open):
|
|
48
50
|
State('location', 'pathname'),
|
49
51
|
)
|
50
52
|
def login_button_click(
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
53
|
+
username_submit,
|
54
|
+
password_submit,
|
55
|
+
n_clicks,
|
56
|
+
username,
|
57
|
+
password,
|
58
|
+
location_href,
|
59
|
+
location_pathname,
|
60
|
+
):
|
59
61
|
"""
|
60
62
|
When the user submits the login form, check the login.
|
61
63
|
On successful login, set the session id.
|
@@ -63,12 +65,18 @@ def login_button_click(
|
|
63
65
|
form_class = 'form-control'
|
64
66
|
ctx = dash.callback_context
|
65
67
|
if not username or not password or not ctx.triggered:
|
66
|
-
|
68
|
+
raise PreventUpdate
|
69
|
+
|
67
70
|
try:
|
68
|
-
|
69
|
-
session_data = {
|
71
|
+
_ = login({'username': username, 'password': password})
|
72
|
+
session_data = {
|
73
|
+
'session-id': str(uuid.uuid4()),
|
74
|
+
'location.href': location_href,
|
75
|
+
}
|
70
76
|
active_sessions[session_data['session-id']] = {'username': username}
|
77
|
+
alerts = []
|
71
78
|
except HTTPException:
|
72
79
|
form_class += ' is-invalid'
|
73
|
-
session_data =
|
74
|
-
|
80
|
+
session_data = dash.no_update
|
81
|
+
alerts = alert_from_success_tuple((False, "Invalid login."))
|
82
|
+
return session_data, form_class, dash.no_update, alerts
|
@@ -31,7 +31,7 @@ registration_div = html.Div(
|
|
31
31
|
else [
|
32
32
|
dcc.Markdown("""
|
33
33
|
#### **Web registration is disabled for security.**
|
34
|
-
You can
|
34
|
+
You can register users via the CLI with `mrsm register user`.
|
35
35
|
"""),
|
36
36
|
dbc.Button(
|
37
37
|
'More information.',
|
@@ -80,6 +80,7 @@ layout = dbc.Container([
|
|
80
80
|
html.Br(),
|
81
81
|
dbc.Container([
|
82
82
|
dcc.Location(id='location-login', refresh=True),
|
83
|
+
html.Div(id="login-alert-div"),
|
83
84
|
html.Div([
|
84
85
|
dbc.Container(
|
85
86
|
html.Img(
|
@@ -129,4 +130,3 @@ layout = dbc.Container([
|
|
129
130
|
]),
|
130
131
|
], className='jumbotron')
|
131
132
|
])
|
132
|
-
|
meerschaum/api/routes/_login.py
CHANGED
@@ -32,16 +32,16 @@ def load_user(
|
|
32
32
|
|
33
33
|
|
34
34
|
@app.post(endpoints['login'], tags=['Users'])
|
35
|
-
|
35
|
+
def login(
|
36
36
|
data: CustomOAuth2PasswordRequestForm = fastapi.Depends()
|
37
|
-
# data: dict[str, str],
|
38
|
-
# request: Request
|
39
37
|
) -> Dict[str, Any]:
|
40
38
|
"""
|
41
39
|
Login and set the session token.
|
42
40
|
"""
|
43
41
|
username, password = (
|
44
|
-
(data
|
42
|
+
(data['username'], data['password'])
|
43
|
+
if isinstance(data, dict)
|
44
|
+
else (data.username, data.password)
|
45
45
|
) if not no_auth else ('no-auth', 'no-auth')
|
46
46
|
|
47
47
|
user = User(username, password)
|
@@ -62,7 +62,7 @@ async def login(
|
|
62
62
|
return {
|
63
63
|
'access_token': access_token,
|
64
64
|
'token_type': 'bearer',
|
65
|
-
'expires'
|
65
|
+
'expires': expires_dt,
|
66
66
|
}
|
67
67
|
|
68
68
|
|
meerschaum/api/routes/_pipes.py
CHANGED
@@ -44,14 +44,14 @@ pd = attempt_import('pandas')
|
|
44
44
|
|
45
45
|
@app.post(pipes_endpoint + '/{connector_keys}/{metric_key}/{location_key}/register', tags=['Pipes'])
|
46
46
|
def register_pipe(
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
47
|
+
connector_keys: str,
|
48
|
+
metric_key: str,
|
49
|
+
location_key: str,
|
50
|
+
parameters: dict,
|
51
|
+
curr_user = (
|
52
|
+
fastapi.Depends(manager) if not no_auth else None
|
53
|
+
),
|
54
|
+
):
|
55
55
|
"""
|
56
56
|
Register a new pipe.
|
57
57
|
"""
|
@@ -376,18 +376,18 @@ def sync_pipe(
|
|
376
376
|
|
377
377
|
@app.get(pipes_endpoint + '/{connector_keys}/{metric_key}/{location_key}/data', tags=['Pipes'])
|
378
378
|
def get_pipe_data(
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
379
|
+
connector_keys: str,
|
380
|
+
metric_key: str,
|
381
|
+
location_key: str,
|
382
|
+
select_columns: Optional[str] = None,
|
383
|
+
omit_columns: Optional[str] = None,
|
384
|
+
begin: Union[str, int, None] = None,
|
385
|
+
end: Union[str, int, None] = None,
|
386
|
+
params: Optional[str] = None,
|
387
|
+
curr_user = (
|
388
|
+
fastapi.Depends(manager) if not no_auth else None
|
389
|
+
),
|
390
|
+
) -> str:
|
391
391
|
"""
|
392
392
|
Get a pipe's data, applying any filtering.
|
393
393
|
|
meerschaum/config/__init__.py
CHANGED
@@ -26,7 +26,14 @@ from meerschaum.config._paths import (
|
|
26
26
|
from meerschaum.config._patch import (
|
27
27
|
apply_patch_to_config,
|
28
28
|
)
|
29
|
-
__all__ = (
|
29
|
+
__all__ = (
|
30
|
+
'get_plugin_config',
|
31
|
+
'write_plugin_config',
|
32
|
+
'get_config',
|
33
|
+
'write_config',
|
34
|
+
'set_config',
|
35
|
+
'paths',
|
36
|
+
)
|
30
37
|
__pdoc__ = {'static': False, 'resources': False, 'stack': False, }
|
31
38
|
_locks = {'config': RLock()}
|
32
39
|
|