File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
src/instrumentman/datatransfer Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 11from io import BufferedWriter , TextIOWrapper
22
33from serial import SerialTimeoutException
4- from click_extra import echo , progressbar
4+ from rich .progress import Progress , TextColumn
5+ from click_extra import echo
56from geocompy .communication import open_serial
67
78from ..utils import echo_green , echo_red , echo_yellow
@@ -68,15 +69,13 @@ def main_upload(
6869 for _ in range (skip ):
6970 next (file )
7071
71- count = 0
72- with progressbar (
73- file ,
74- label = "Uploading data" ,
75- item_show_func = lambda x : f"{ count } line(s)"
76- ) as bar :
77- for line in bar :
72+ with Progress (
73+ * Progress .get_default_columns (),
74+ TextColumn ("{task.completed} line(s)" )
75+ ) as progress :
76+ for line in progress .track (file , description = "Uploading..." ):
7877 com .send (line )
79- count += 1
78+
8079 except Exception as e :
8180 echo_red (f"Upload interrupted by error ({ e } )" )
8281 return
You can’t perform that action at this time.
0 commit comments