Skip to contentSkip to conversation

hig/builder: use the new which_terminal() function

PATCH In review Saul Wold 2 participants 2 messages Apr 10, 2012

lore
Share & tools
lore

Saul Wold

author
#0 lore raw

PATCH 2/2 hig/builder: use the new which_terminal() function

---
 lib/bb/ui/crumbs/builder.py |    7 ++++---
 lib/bb/ui/crumbs/hig.py     |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
lib/bb/ui/crumbs/builder.py +4 -3
index a3410d4..e48afde 100755
@@ -37,6 +37,7 @@ from bb.ui.crumbs.hig import CrumbsMessageDialog, ImageSelectionDialog, \
                              AdvancedSettingDialog, LayerSelectionDialog, \
                              DeployImageDialog
 from bb.ui.crumbs.persistenttooltip import PersistentTooltip
+import bb.ui.crumbs.utils
 
 class Configuration:
     '''Represents the data structure of configuration.'''
@@ -946,10 +947,10 @@ class Builder(gtk.Window):
             tmp_path = self.parameters.tmpdir
             if os.path.exists(image_path) and os.path.exists(kernel_path) \
                and os.path.exists(source_env_path) and os.path.exists(tmp_path):
-                cmdline = "/usr/bin/xterm -e "
-                cmdline += "\" export OE_TMPDIR=" + tmp_path + "; "
+                cmdline = bb.ui.crumbs.utils.which_terminal()
+                cmdline += "\' bash -c \"export OE_TMPDIR=" + tmp_path + "; "
                 cmdline += "source " + source_env_path + " " + os.getcwd() + "; "
-                cmdline += "runqemu " + kernel_path + " " + image_path + "; bash\""
+                cmdline += "runqemu " + kernel_path + " " + image_path + "\"\'"
                 subprocess.Popen(shlex.split(cmdline))
             else:
                 lbl = "<b>Path error</b>\nOne of your paths is wrong,"
lib/bb/ui/crumbs/hig.py +2 -1
index 9adb281..508503c 100644
@@ -30,6 +30,7 @@ import shlex
 from bb.ui.crumbs.hobcolor import HobColors
 from bb.ui.crumbs.hobwidget import hcc, hic, HobViewTable, HobInfoButton, HobButton, HobAltButton, HobIconChecker
 from bb.ui.crumbs.progressbar import HobProgressBar
+import bb.ui.crumbs.utils
 
 """
 The following are convenience classes for implementing GNOME HIG compliant
@@ -737,7 +738,7 @@ class DeployImageDialog (CrumbsDialog):
         if response_id == gtk.RESPONSE_YES:
             combo_item = self.usb_combo.get_active_text()
             if combo_item and combo_item != self.__dummy_usb__:
-                cmdline = "/usr/bin/xterm -e "
+                cmdline = bb.ui.crumbs.utils.which_terminal()
                 cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "; bash\""
                 subprocess.Popen(args=shlex.split(cmdline))
 
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 19 lines · Saul Wold
---
 lib/bb/ui/crumbs/builder.py |    7 ++++---
 lib/bb/ui/crumbs/hig.py     |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)
lib/bb/ui/crumbs/builder.py +1 -0
index a3410d4..e48afde 100755
@@ -37,6 +37,7 @@ from bb.ui.crumbs.hig import CrumbsMessageDialog, ImageSelectionDialog, \
                              AdvancedSettingDialog, LayerSelectionDialog, \
                              DeployImageDialog
 from bb.ui.crumbs.persistenttooltip import PersistentTooltip
+import bb.ui.crumbs.utils
 
 class Configuration:
     '''Represents the data structure of configuration.'''

lib/bb/ui/crumbs/builder.py class Builder(gtk.Window): · line 953

Quoted 10 lines
lib/bb/ui/crumbs/builder.py +3 -3
@@ -946,10 +947,10 @@ class Builder(gtk.Window):
             tmp_path = self.parameters.tmpdir
             if os.path.exists(image_path) and os.path.exists(kernel_path) \
                and os.path.exists(source_env_path) and os.path.exists(tmp_path):
-                cmdline = "/usr/bin/xterm -e "
-                cmdline += "\" export OE_TMPDIR=" + tmp_path + "; "
+                cmdline = bb.ui.crumbs.utils.which_terminal()
+                cmdline += "\' bash -c \"export OE_TMPDIR=" + tmp_path + "; "
                 cmdline += "source " + source_env_path + " " + os.getcwd() + "; "
-                cmdline += "runqemu " + kernel_path + " " + image_path + "; bash\""
+                cmdline += "runqemu " + kernel_path + " " + image_path + "\"\'"

This appears to do a bit more than you describe in the change message? You also should check the return value of bb.ui.crumbs.utils.which_terminal().

Quoted 16 lines
lib/bb/ui/crumbs/builder.py +0 -0
                 subprocess.Popen(shlex.split(cmdline))
             else:
                 lbl = "<b>Path error</b>\nOne of your paths is wrong,"
lib/bb/ui/crumbs/hig.py +1 -0
index 9adb281..508503c 100644
@@ -30,6 +30,7 @@ import shlex
 from bb.ui.crumbs.hobcolor import HobColors
 from bb.ui.crumbs.hobwidget import hcc, hic, HobViewTable, HobInfoButton, HobButton, HobAltButton, HobIconChecker
 from bb.ui.crumbs.progressbar import HobProgressBar
+import bb.ui.crumbs.utils
 
 """
 The following are convenience classes for implementing GNOME HIG compliant

lib/bb/ui/crumbs/hig.py class DeployImageDialog (CrumbsDialog): · line 743

Quoted 7 lines
lib/bb/ui/crumbs/hig.py +1 -1
@@ -737,7 +738,7 @@ class DeployImageDialog (CrumbsDialog):
         if response_id == gtk.RESPONSE_YES:
             combo_item = self.usb_combo.get_active_text()
             if combo_item and combo_item != self.__dummy_usb__:
-                cmdline = "/usr/bin/xterm -e "
+                cmdline = bb.ui.crumbs.utils.which_terminal()
                 cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "; bash\""
                 subprocess.Popen(args=shlex.split(cmdline))

So you remove the bash above but not here?

Cheers,

Richard