bluer-ugv 7.359.1__py3-none-any.whl → 7.432.1__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.
Files changed (46) hide show
  1. bluer_ugv/.abcli/swallow/dataset.sh +1 -1
  2. bluer_ugv/.abcli/swallow/video/play.sh +7 -0
  3. bluer_ugv/.abcli/swallow/video/playlist/cat.sh +14 -0
  4. bluer_ugv/.abcli/swallow/video/playlist/download.sh +18 -0
  5. bluer_ugv/.abcli/swallow/video/playlist/edit.sh +14 -0
  6. bluer_ugv/.abcli/swallow/video/playlist/upload.sh +9 -0
  7. bluer_ugv/.abcli/swallow/video/playlist.sh +15 -0
  8. bluer_ugv/.abcli/swallow/video.sh +15 -0
  9. bluer_ugv/.abcli/swallow.sh +1 -1
  10. bluer_ugv/.abcli/tests/help.sh +8 -0
  11. bluer_ugv/.abcli/tests/swallow_video_play.sh +11 -0
  12. bluer_ugv/.abcli/tests/swallow_video_playlist.sh +45 -0
  13. bluer_ugv/README/build.py +2 -2
  14. bluer_ugv/README/{shield → computer}/box.py +1 -1
  15. bluer_ugv/README/computer/docs.py +21 -0
  16. bluer_ugv/README/{shield → computer}/pcb.py +3 -3
  17. bluer_ugv/README/computer/power.py +19 -0
  18. bluer_ugv/README/{shield → computer}/schematics.py +1 -1
  19. bluer_ugv/README/{shield → computer}/testing.py +1 -1
  20. bluer_ugv/README/rangin/__init__.py +0 -3
  21. bluer_ugv/README/shortcuts.py +2 -2
  22. bluer_ugv/README/swallow/digital/design/__init__.py +4 -4
  23. bluer_ugv/__init__.py +1 -1
  24. bluer_ugv/config.env +3 -1
  25. bluer_ugv/env.py +2 -0
  26. bluer_ugv/help/swallow/__init__.py +2 -0
  27. bluer_ugv/help/swallow/video/__init__.py +0 -0
  28. bluer_ugv/help/swallow/video/functions.py +41 -0
  29. bluer_ugv/help/swallow/video/playlist.py +89 -0
  30. bluer_ugv/swallow/session/classical/screen/__init__.py +0 -0
  31. bluer_ugv/swallow/session/classical/screen/classes.py +42 -0
  32. bluer_ugv/swallow/session/classical/screen/video/__init__.py +0 -0
  33. bluer_ugv/swallow/session/classical/screen/video/__main__.py +99 -0
  34. bluer_ugv/swallow/session/classical/screen/video/engine.py +125 -0
  35. bluer_ugv/swallow/session/classical/screen/video/player.py +117 -0
  36. bluer_ugv/swallow/session/classical/screen/video/playlist.py +116 -0
  37. bluer_ugv/swallow/session/classical/session.py +11 -7
  38. bluer_ugv/swallow/session/classical/ultrasonic_sensor/log.py +3 -0
  39. {bluer_ugv-7.359.1.dist-info → bluer_ugv-7.432.1.dist-info}/METADATA +3 -3
  40. {bluer_ugv-7.359.1.dist-info → bluer_ugv-7.432.1.dist-info}/RECORD +44 -25
  41. bluer_ugv/README/shield/docs.py +0 -17
  42. bluer_ugv/swallow/session/classical/screen.py +0 -11
  43. /bluer_ugv/README/{shield → computer}/__init__.py +0 -0
  44. {bluer_ugv-7.359.1.dist-info → bluer_ugv-7.432.1.dist-info}/WHEEL +0 -0
  45. {bluer_ugv-7.359.1.dist-info → bluer_ugv-7.432.1.dist-info}/licenses/LICENSE +0 -0
  46. {bluer_ugv-7.359.1.dist-info → bluer_ugv-7.432.1.dist-info}/top_level.txt +0 -0
@@ -9,7 +9,7 @@ function bluer_ugv_swallow_dataset() {
9
9
  return
10
10
  fi
11
11
 
12
- python3 - bluer_ugv.swallow.dataset "$@"
12
+ python3 -m bluer_ugv.swallow.dataset "$@"
13
13
  }
14
14
 
15
15
  bluer_ai_source_caller_suffix_path /dataset
@@ -0,0 +1,7 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video_play() {
4
+ python3 -m bluer_ugv.swallow.session.classical.screen.video \
5
+ play \
6
+ "$@"
7
+ }
@@ -0,0 +1,14 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video_playlist_cat() {
4
+ local options=$1
5
+ local do_download=$(bluer_ai_option_int "$options" download 0)
6
+
7
+ [[ "$do_download" == 1 ]] &&
8
+ bluer_ugv_swallow_video_playlist_download \
9
+ filename=void \
10
+ $RANGIN_VIDEO_LIST_OBJECT
11
+
12
+ bluer_ai_cat \
13
+ $ABCLI_OBJECT_ROOT/$RANGIN_VIDEO_LIST_OBJECT/metadata.yaml
14
+ }
@@ -0,0 +1,18 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video_playlist_download() {
4
+ local options=${1:-policy=doesnt_exist}
5
+
6
+ [[ "$abcli_is_rpi" == true ]] &&
7
+ sudo chown pi:pi \
8
+ $ABCLI_OBJECT_ROOT/$RANGIN_VIDEO_LIST_OBJECT
9
+
10
+ bluer_objects_download \
11
+ filename=metadata.yaml \
12
+ $RANGIN_VIDEO_LIST_OBJECT
13
+ [[ $? -ne 0 ]] && return 1
14
+
15
+ bluer_objects_download \
16
+ ,$options \
17
+ $RANGIN_VIDEO_LIST_OBJECT
18
+ }
@@ -0,0 +1,14 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video_playlist_edit() {
4
+ local options=$1
5
+ local do_download=$(bluer_ai_option_int "$options" download 0)
6
+
7
+ [[ "$do_download" == 1 ]] &&
8
+ bluer_ugv_swallow_video_playlist_download \
9
+ filename=void \
10
+ $RANGIN_VIDEO_LIST_OBJECT
11
+
12
+ bluer_ai_code \
13
+ $ABCLI_OBJECT_ROOT/$RANGIN_VIDEO_LIST_OBJECT/metadata.yaml
14
+ }
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video_playlist_upload() {
4
+ local options=${1:-filename=metadata.yaml}
5
+
6
+ bluer_objects_upload \
7
+ ,$options \
8
+ $RANGIN_VIDEO_LIST_OBJECT
9
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video_playlist() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_ugv_swallow_video_playlist_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_ugv.swallow.session.classical.screen.video "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /playlist
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_ugv_swallow_video() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_ugv_swallow_video_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_ugv.swallow.session.classical.screen.video "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /video
@@ -9,7 +9,7 @@ function bluer_ugv_swallow() {
9
9
  return
10
10
  fi
11
11
 
12
- python3 - bluer_ugv.swallow "$@"
12
+ python3 -m bluer_ugv.swallow "$@"
13
13
  }
14
14
 
15
15
  bluer_ai_source_caller_suffix_path /swallow
@@ -29,6 +29,14 @@ function test_bluer_ugv_help() {
29
29
  "@swallow ultrasonic review" \
30
30
  "@swallow ultrasonic test" \
31
31
  \
32
+ "@swallow video" \
33
+ "@swallow video play" \
34
+ "@swallow video playlist" \
35
+ "@swallow video playlist cat" \
36
+ "@swallow video playlist download" \
37
+ "@swallow video playlist edit" \
38
+ "@swallow video playlist upload" \
39
+ \
32
40
  "@ugv" \
33
41
  \
34
42
  "@ugv git" \
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_swallow_video_play() {
4
+ local options=$1
5
+
6
+ bluer_ai_eval ,$options \
7
+ bluer_ugv \
8
+ swallow \
9
+ video \
10
+ play
11
+ }
@@ -0,0 +1,45 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_swallow_video_playlist_cat() {
4
+ local options=$1
5
+
6
+ bluer_ai_eval ,$options \
7
+ bluer_ugv \
8
+ swallow \
9
+ video \
10
+ playlist \
11
+ cat
12
+ }
13
+
14
+ function test_swallow_video_playlist_download_upload() {
15
+ local options=$1
16
+
17
+ bluer_ai_eval ,$options \
18
+ bluer_ugv \
19
+ swallow \
20
+ video \
21
+ playlist \
22
+ download \
23
+ policy=doesnt_exist
24
+ [[ $? -ne 0 ]] && return 1
25
+
26
+ bluer_ai_eval ,$options \
27
+ bluer_ugv \
28
+ swallow \
29
+ video \
30
+ playlist \
31
+ upload \
32
+ filename=metadata.yaml
33
+ }
34
+
35
+ function test_swallow_video_playlist_edit() {
36
+ local options=$1
37
+
38
+ bluer_ai_eval ,$options \
39
+ bluer_ugv \
40
+ swallow \
41
+ video \
42
+ playlist \
43
+ edit \
44
+ download
45
+ }
bluer_ugv/README/build.py CHANGED
@@ -17,7 +17,7 @@ from bluer_ugv.README import (
17
17
  releases,
18
18
  swallow,
19
19
  )
20
- from bluer_ugv.README.shield import docs as shield
20
+ from bluer_ugv.README.computer import docs as computer
21
21
  from bluer_ugv.README.ugvs import docs as ugvs
22
22
  from bluer_ugv.README.ugvs.comparison.build import build as build_comparison
23
23
 
@@ -49,7 +49,7 @@ def build() -> bool:
49
49
  + rangin.docs
50
50
  + ravin.docs
51
51
  + releases.docs
52
- + shield.docs
52
+ + computer.docs
53
53
  + ugvs.docs
54
54
  + swallow.docs
55
55
  )
@@ -19,7 +19,7 @@ items = ImageItems(
19
19
 
20
20
  docs = [
21
21
  {
22
- "path": "../docs/swallow/digital/design/shield/box.md",
22
+ "path": "../docs/swallow/digital/design/computer/box.md",
23
23
  "items": items,
24
24
  }
25
25
  ]
@@ -0,0 +1,21 @@
1
+ from bluer_ugv.README.computer import box, pcb, power, schematics, testing
2
+
3
+
4
+ docs = (
5
+ [
6
+ {
7
+ "path": "../docs/swallow/digital/design/computer",
8
+ },
9
+ {
10
+ "path": "../docs/swallow/digital/design/computer/naming.md",
11
+ },
12
+ {
13
+ "path": "../docs/swallow/digital/design/computer/connectors-v1.md",
14
+ },
15
+ ]
16
+ + box.docs
17
+ + pcb.docs
18
+ + power.docs
19
+ + schematics.docs
20
+ + testing.docs
21
+ )
@@ -35,15 +35,15 @@ v2_items = ImageItems(
35
35
 
36
36
  docs = [
37
37
  {
38
- "path": "../docs/swallow/digital/design/shield/pcb.md",
38
+ "path": "../docs/swallow/digital/design/computer/pcb.md",
39
39
  "items": items,
40
40
  },
41
41
  {
42
- "path": "../docs/swallow/digital/design/shield/v1.md",
42
+ "path": "../docs/swallow/digital/design/computer/v1.md",
43
43
  "items": v1_items,
44
44
  },
45
45
  {
46
- "path": "../docs/swallow/digital/design/shield/v2.md",
46
+ "path": "../docs/swallow/digital/design/computer/v2.md",
47
47
  "items": v2_items,
48
48
  },
49
49
  ]
@@ -0,0 +1,19 @@
1
+ from bluer_objects.README.items import ImageItems
2
+
3
+ from bluer_ugv.README.swallow.consts import swallow_assets2, swallow_designs
4
+
5
+
6
+ items = ImageItems(
7
+ {
8
+ f"{swallow_assets2}/20251119_193930.jpg": "",
9
+ f"{swallow_assets2}/20251119_193954.jpg": "",
10
+ }
11
+ )
12
+
13
+
14
+ docs = [
15
+ {
16
+ "path": "../docs/swallow/digital/design/computer/power.md",
17
+ "items": items,
18
+ },
19
+ ]
@@ -11,7 +11,7 @@ items = ImageItems(
11
11
 
12
12
  docs = [
13
13
  {
14
- "path": "../docs/swallow/digital/design/shield/schematics.md",
14
+ "path": "../docs/swallow/digital/design/computer/schematics.md",
15
15
  "items": items,
16
16
  },
17
17
  ]
@@ -12,7 +12,7 @@ items = ImageItems(
12
12
 
13
13
  docs = [
14
14
  {
15
- "path": "../docs/swallow/digital/design/shield/testing.md",
15
+ "path": "../docs/swallow/digital/design/computer/testing.md",
16
16
  "items": items,
17
17
  },
18
18
  ]
@@ -78,7 +78,4 @@ docs = [
78
78
  ]
79
79
  ),
80
80
  },
81
- {
82
- "path": "../docs/rangin/computers.md",
83
- },
84
81
  ]
@@ -11,8 +11,8 @@ items = markdown.generate_table(
11
11
  Items(
12
12
  [
13
13
  {
14
- "name": "shield",
15
- "url": "./bluer_ugv/docs/swallow/digital/design/shield",
14
+ "name": "computer",
15
+ "url": "./bluer_ugv/docs/swallow/digital/design/computer",
16
16
  "marquee": f"{swallow_electrical_designs}/digital.png?raw=true",
17
17
  },
18
18
  {
@@ -7,7 +7,10 @@ from bluer_ugv.README.swallow.consts import (
7
7
  swallow_electrical_designs,
8
8
  )
9
9
  from bluer_ugv.designs.swallow.parts import dict_of_parts
10
- from bluer_ugv.README.swallow.digital.design import mechanical, ultrasonic_sensor
10
+ from bluer_ugv.README.swallow.digital.design import (
11
+ mechanical,
12
+ ultrasonic_sensor,
13
+ )
11
14
  from bluer_ugv.swallow.session.classical.keyboard.keys import ControlKeys
12
15
 
13
16
 
@@ -16,9 +19,6 @@ docs = (
16
19
  {
17
20
  "path": "../docs/swallow/digital/design",
18
21
  },
19
- {
20
- "path": "../docs/swallow/digital/design/computers.md",
21
- },
22
22
  {
23
23
  "path": "../docs/swallow/digital/design/operation.md",
24
24
  "cols": 2,
bluer_ugv/__init__.py CHANGED
@@ -4,7 +4,7 @@ ICON = "🐬"
4
4
 
5
5
  DESCRIPTION = f"{ICON} AI x UGV."
6
6
 
7
- VERSION = "7.359.1"
7
+ VERSION = "7.432.1"
8
8
 
9
9
  REPO_NAME = "bluer-ugv"
10
10
 
bluer_ugv/config.env CHANGED
@@ -27,4 +27,6 @@ BLUER_UGV_ULTRASONIC_SENSOR_MAX_M=0.8
27
27
 
28
28
  BLUER_UGV_ULTRASONIC_SENSOR_KEEP_LOG=1
29
29
 
30
- BLUER_UGV_ULTRASONIC_SENSOR_LOG=0
30
+ BLUER_UGV_ULTRASONIC_SENSOR_LOG=0
31
+
32
+ RANGIN_VIDEO_LIST_OBJECT=rangin-video-list-1
bluer_ugv/env.py CHANGED
@@ -81,3 +81,5 @@ BLUER_UGV_ULTRASONIC_SENSOR_LOG = get_env(
81
81
  "BLUER_UGV_ULTRASONIC_SENSOR_LOG",
82
82
  1,
83
83
  )
84
+
85
+ RANGIN_VIDEO_LIST_OBJECT = get_env("RANGIN_VIDEO_LIST_OBJECT")
@@ -6,6 +6,7 @@ from bluer_ugv.help.swallow.select_target import help_select_target
6
6
  from bluer_ugv.help.swallow.ultrasonic_sensor import (
7
7
  help_functions as help_ultrasonic_sensor,
8
8
  )
9
+ from bluer_ugv.help.swallow.video.functions import help_functions as help_video
9
10
 
10
11
  help_functions = {
11
12
  "dataset": help_dataset,
@@ -14,4 +15,5 @@ help_functions = {
14
15
  "keyboard": help_keyboard,
15
16
  "select_target": help_select_target,
16
17
  "ultrasonic": help_ultrasonic_sensor,
18
+ "video": help_video,
17
19
  }
File without changes
@@ -0,0 +1,41 @@
1
+ from typing import List
2
+
3
+ from bluer_options.terminal import show_usage, xtra
4
+
5
+ from bluer_ugv import env
6
+ from bluer_ugv.help.swallow.video.playlist import help_functions as help_playlist
7
+ from bluer_ugv.swallow.session.classical.screen.video.engine import VideoEngine
8
+
9
+
10
+ def help_play(
11
+ tokens: List[str],
12
+ mono: bool,
13
+ ) -> str:
14
+ args = [
15
+ "[--dryrun 1]",
16
+ "[--download 0]",
17
+ "[--engine {}]".format(
18
+ " | ".join(sorted([engine.name.lower() for engine in VideoEngine]))
19
+ ),
20
+ "[--loop 0]",
21
+ f"[--object_name <{env.RANGIN_VIDEO_LIST_OBJECT}>]",
22
+ "[--timeout <-1 | 10>]",
23
+ "[--video <loading|1>]",
24
+ ]
25
+
26
+ return show_usage(
27
+ [
28
+ "@swallow",
29
+ "video",
30
+ "play",
31
+ ]
32
+ + args,
33
+ "play <object-name>/<video>.",
34
+ mono=mono,
35
+ )
36
+
37
+
38
+ help_functions = {
39
+ "play": help_play,
40
+ "playlist": help_playlist,
41
+ }
@@ -0,0 +1,89 @@
1
+ from typing import List
2
+
3
+ from bluer_options.terminal import show_usage, xtra
4
+ from bluer_objects.help.download import options as download_options
5
+ from bluer_objects.help.upload import options as upload_options
6
+
7
+
8
+ def help_cat(
9
+ tokens: List[str],
10
+ mono: bool,
11
+ ) -> str:
12
+ options = xtra("download", mono=mono)
13
+
14
+ return show_usage(
15
+ [
16
+ "@swallow",
17
+ "video",
18
+ "playlist",
19
+ "cat",
20
+ f"[{options}]",
21
+ ],
22
+ "cat swallow playlist.",
23
+ mono=mono,
24
+ )
25
+
26
+
27
+ def help_download(
28
+ tokens: List[str],
29
+ mono: bool,
30
+ ) -> str:
31
+ options = download_options(mono=mono)
32
+
33
+ return show_usage(
34
+ [
35
+ "@swallow",
36
+ "video",
37
+ "playlist",
38
+ "download",
39
+ f"[{options}]",
40
+ ],
41
+ "download swallow playlist.",
42
+ mono=mono,
43
+ )
44
+
45
+
46
+ def help_edit(
47
+ tokens: List[str],
48
+ mono: bool,
49
+ ) -> str:
50
+ options = xtra("download", mono=mono)
51
+
52
+ return show_usage(
53
+ [
54
+ "@swallow",
55
+ "video",
56
+ "playlist",
57
+ "edit",
58
+ f"[{options}]",
59
+ ],
60
+ "edit swallow playlist.",
61
+ mono=mono,
62
+ )
63
+
64
+
65
+ def help_upload(
66
+ tokens: List[str],
67
+ mono: bool,
68
+ ) -> str:
69
+ options = upload_options(mono=mono)
70
+
71
+ return show_usage(
72
+ [
73
+ "@swallow",
74
+ "video",
75
+ "playlist",
76
+ "upload",
77
+ f"[{options}]",
78
+ ],
79
+ "upload swallow playlist.",
80
+ mono=mono,
81
+ )
82
+
83
+
84
+ help_functions = {
85
+ "cat": help_cat,
86
+ "download": help_download,
87
+ "edit": help_edit,
88
+ "upload": help_upload,
89
+ }
File without changes
@@ -0,0 +1,42 @@
1
+ from bluer_options.host.functions import is_headless
2
+
3
+ from bluer_ugv import env
4
+ from bluer_ugv.swallow.session.classical.screen.video.player import VideoPlayer
5
+ from bluer_ugv.swallow.session.classical.screen.video.playlist import PlayList
6
+ from bluer_ugv.logger import logger
7
+
8
+
9
+ class ClassicalScreen:
10
+ def __init__(self):
11
+ self.video_player = None if is_headless() else VideoPlayer()
12
+
13
+ self.playlist = PlayList(env.RANGIN_VIDEO_LIST_OBJECT)
14
+
15
+ logger.info(f"{self.__class__.__name__} created.")
16
+
17
+ def cleanup(self):
18
+ logger.info(f"{self.__class__.__name__}.cleanup")
19
+ self.video_player.stop()
20
+
21
+ def initialize(self) -> bool:
22
+ if self.video_player is None:
23
+ return True
24
+
25
+ return self.video_player.play(
26
+ self.playlist.get("loading"),
27
+ loop=True,
28
+ )
29
+
30
+ def update(self) -> bool:
31
+ if self.video_player is None:
32
+ return True
33
+
34
+ if self.video_player.process:
35
+ return True
36
+
37
+ self.playlist.next()
38
+
39
+ return self.video_player.play(
40
+ self.playlist.get(self.playlist.index),
41
+ loop=False,
42
+ )
@@ -0,0 +1,99 @@
1
+ import argparse
2
+ import time
3
+
4
+ from blueness import module
5
+ from blueness.argparse.generic import sys_exit
6
+ from bluer_options.host import is_rpi, is_headless
7
+ from bluer_options import string
8
+
9
+ from bluer_ugv import NAME, env
10
+ from bluer_ugv.swallow.session.classical.screen.video.playlist import PlayList
11
+ from bluer_ugv.swallow.session.classical.screen.video.player import VideoPlayer
12
+ from bluer_ugv.swallow.session.classical.screen.video.engine import VideoEngine
13
+ from bluer_ugv.logger import logger
14
+
15
+ NAME = module.name(__file__, NAME)
16
+
17
+ parser = argparse.ArgumentParser(NAME)
18
+ parser.add_argument(
19
+ "task",
20
+ type=str,
21
+ help="play",
22
+ )
23
+ parser.add_argument(
24
+ "--download",
25
+ type=int,
26
+ default=1,
27
+ help="0|1",
28
+ )
29
+ parser.add_argument(
30
+ "--dryrun",
31
+ type=int,
32
+ default=int(not is_rpi() or is_headless()),
33
+ help="0|1",
34
+ )
35
+ parser.add_argument(
36
+ "--engine",
37
+ type=str,
38
+ default=VideoEngine.VLC.name.lower(),
39
+ help=" | ".join(sorted([engine.name.lower() for engine in VideoEngine])),
40
+ )
41
+ parser.add_argument(
42
+ "--loop",
43
+ type=int,
44
+ default=1,
45
+ help="0|1",
46
+ )
47
+ parser.add_argument(
48
+ "--object_name",
49
+ type=str,
50
+ default=env.RANGIN_VIDEO_LIST_OBJECT,
51
+ )
52
+ parser.add_argument(
53
+ "--timeout",
54
+ type=int,
55
+ default=-1,
56
+ help="in seconds, -1: never",
57
+ )
58
+ parser.add_argument(
59
+ "--video",
60
+ type=str,
61
+ default="loading",
62
+ )
63
+ args = parser.parse_args()
64
+
65
+
66
+ success = False
67
+ if args.task == "play":
68
+ playlist = PlayList(
69
+ args.object_name,
70
+ download=args.download == 1,
71
+ )
72
+
73
+ video_player = VideoPlayer(
74
+ args.dryrun == 1,
75
+ engine=VideoEngine[args.engine.upper()],
76
+ )
77
+
78
+ success = video_player.play(
79
+ filename=playlist.get(args.video),
80
+ loop=args.loop == 1,
81
+ )
82
+
83
+ if success and args.timeout > 0:
84
+ logger.info(
85
+ "waiting for {}".format(
86
+ string.pretty_duration(
87
+ args.timeout,
88
+ )
89
+ )
90
+ )
91
+ time.sleep(args.timeout)
92
+ success = video_player.stop()
93
+
94
+ logger.info('💡 type in "reset" if the prompt is invisible.')
95
+
96
+ else:
97
+ success = None
98
+
99
+ sys_exit(logger, NAME, args.task, success)