Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions scripts/rqt_embed_window
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import sys

from rqt_embed_window.RqtEmbedWindow import RqtEmbedWindow
from rqt_gui.main import Main

main = Main(filename='rqt_embed_window')
Expand Down
4 changes: 2 additions & 2 deletions scripts/test_if_window_can_be_embedded.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

def get_window_id_by_pid(pid):
"""
Expand All @@ -21,6 +21,7 @@ def get_window_id_by_pid(pid):
return int(fields[0], 16)
return None


def run_app(window_id):
from PyQt5.QtGui import QWindow
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QApplication, QPushButton
Expand Down Expand Up @@ -48,7 +49,6 @@ def run_app(window_id):

main_widget.show()
app.exec_()



if __name__ == '__main__':
Expand Down
2 changes: 1 addition & 1 deletion src/rqt_embed_window/RqtEmbedWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from python_qt_binding.QtGui import QWindow
from python_qt_binding.QtCore import Qt
from qt_gui.settings import Settings
from shell_cmd import ShellCmd
from rqt_embed_window.shell_cmd import ShellCmd


def get_window_id_by_window_name(window_name):
Expand Down
15 changes: 7 additions & 8 deletions src/rqt_embed_window/shell_cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import subprocess
import tempfile
Expand Down Expand Up @@ -52,7 +52,6 @@ def wait_until_done(self):
while not self.is_done():
time.sleep(0.1)


def get_pid(self):
return self.process.pid

Expand All @@ -68,14 +67,14 @@ def kill(self):
cmd = ShellCmd("sleep 3")
try:
while not cmd.is_done():
print "Still sleeping..."
print("Still sleeping...")
time.sleep(0.5)
except KeyboardInterrupt:
print "Pressed Control+C, stopping command."
print("Pressed Control+C, stopping command.")
cmd.kill()
if cmd.is_succeeded():
print "The command finished succesfully"
print "It printed: " + str(cmd.get_stdout())
print("The command finished succesfully")
print("It printed: " + str(cmd.get_stdout()))
else:
print "The command didn't finish succesfully"
print "Its stderr was: " + str(cmd.get_stdout())
print("The command didn't finish succesfully")
print("Its stderr was: " + str(cmd.get_stdout()))