Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
taste-setup
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TASTE
taste-setup
Commits
a2120328
Commit
a2120328
authored
Sep 19, 2017
by
Maxime Perrotin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add basis for a generic progress bar
parent
9c564ee7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
misc/helper-scripts/taste-progress-dialog.py
misc/helper-scripts/taste-progress-dialog.py
+65
-0
No files found.
misc/helper-scripts/taste-progress-dialog.py
0 → 100755
View file @
a2120328
#!/usr/bin/env python
import
sys
import
PySide
import
time
import
signal
from
PySide.QtCore
import
QThread
,
Signal
,
QObject
from
PySide.QtGui
import
(
QApplication
,
QMessageBox
,
QProgressDialog
)
class
MyThread
(
QThread
,
QObject
):
signal
=
Signal
(
str
)
progress
=
Signal
(
int
)
quit
=
Signal
()
def
run
(
self
):
value
=
10
while
True
:
# read from stdin without any buffering
line
=
sys
.
stdin
.
readline
()
if
len
(
line
)
==
0
:
print
(
"Bye"
)
self
.
quit
.
emit
()
return
elif
line
[
0
]
==
'q'
:
print
(
"Quit"
)
self
.
quit
.
emit
()
return
else
:
self
.
signal
.
emit
(
line
)
self
.
progress
.
emit
(
value
)
value
+=
10
if
value
==
100
:
value
=
0
time
.
sleep
(
0.1
)
def
check_crazyflie
():
''' This function should be in a different module '''
return
def
check_snoopy
():
raise
NotImplementedError
()
def
run_gui
():
app
=
QApplication
(
sys
.
argv
)
thread
=
MyThread
()
progress
=
QProgressDialog
()
progress
.
setValue
(
0
)
thread
.
signal
.
connect
(
progress
.
setLabelText
)
thread
.
quit
.
connect
(
progress
.
cancel
)
thread
.
progress
.
connect
(
progress
.
setValue
)
thread
.
start
()
progress
.
exec_
()
def
main
():
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_DFL
)
run_gui
()
if
__name__
==
'__main__'
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment