* [PATCH 2/2] hig/builder: use the new which_terminal() function
@ 2012-04-10 22:20 Saul Wold
2012-04-10 22:54 ` Richard Purdie
0 siblings, 1 reply; 3+ messages in thread
From: Saul Wold @ 2012-04-10 22:20 UTC (permalink / raw)
To: bitbake-devel
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
lib/bb/ui/crumbs/builder.py | 7 ++++---
lib/bb/ui/crumbs/hig.py | 3 ++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index a3410d4..e48afde 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -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,"
diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
index 9adb281..508503c 100644
--- a/lib/bb/ui/crumbs/hig.py
+++ b/lib/bb/ui/crumbs/hig.py
@@ -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))
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] hig/builder: use the new which_terminal() function
2012-04-10 22:20 [PATCH 2/2] hig/builder: use the new which_terminal() function Saul Wold
@ 2012-04-10 22:54 ` Richard Purdie
0 siblings, 0 replies; 3+ messages in thread
From: Richard Purdie @ 2012-04-10 22:54 UTC (permalink / raw)
To: Saul Wold; +Cc: bitbake-devel
On Tue, 2012-04-10 at 15:20 -0700, Saul Wold wrote:
> Signed-off-by: Saul Wold <sgw@linux.intel.com>
> ---
> lib/bb/ui/crumbs/builder.py | 7 ++++---
> lib/bb/ui/crumbs/hig.py | 3 ++-
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
> index a3410d4..e48afde 100755
> --- a/lib/bb/ui/crumbs/builder.py
> +++ b/lib/bb/ui/crumbs/builder.py
> @@ -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 + "\"\'"
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().
> subprocess.Popen(shlex.split(cmdline))
> else:
> lbl = "<b>Path error</b>\nOne of your paths is wrong,"
> diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
> index 9adb281..508503c 100644
> --- a/lib/bb/ui/crumbs/hig.py
> +++ b/lib/bb/ui/crumbs/hig.py
> @@ -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))
So you remove the bash above but not here?
Cheers,
Richard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] hig/builder: use the new which_terminal() function
@ 2012-04-11 0:57 Saul Wold
0 siblings, 0 replies; 3+ messages in thread
From: Saul Wold @ 2012-04-11 0:57 UTC (permalink / raw)
To: bitbake-devel
Also adjusted the cmdline ordering to work correctly
with both xterm and vte.
Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
lib/bb/ui/crumbs/builder.py | 11 +++++++----
lib/bb/ui/crumbs/hig.py | 8 +++++---
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/lib/bb/ui/crumbs/builder.py b/lib/bb/ui/crumbs/builder.py
index a3410d4..6ff16ed 100755
--- a/lib/bb/ui/crumbs/builder.py
+++ b/lib/bb/ui/crumbs/builder.py
@@ -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.'''
@@ -944,12 +945,13 @@ class Builder(gtk.Window):
if response == gtk.RESPONSE_YES:
source_env_path = os.path.join(self.parameters.core_base, "oe-init-build-env")
tmp_path = self.parameters.tmpdir
+ cmdline = bb.ui.crumbs.utils.which_terminal()
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 + "; "
+ and os.path.exists(source_env_path) and os.path.exists(tmp_path)
+ and cmdline:
+ 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,"
@@ -958,6 +960,7 @@ class Builder(gtk.Window):
lbl = lbl + "kernel path:" + kernel_path + "\n"
lbl = lbl + "source environment path:" + source_env_path + "\n"
lbl = lbl + "tmp path: " + tmp_path + "."
+ lbl = lbl + "You may be missing either xterm or vte for terminal services."
dialog = CrumbsMessageDialog(self, lbl, gtk.STOCK_DIALOG_ERROR)
button = dialog.add_button("Close", gtk.RESPONSE_OK)
HobButton.style_button(button)
diff --git a/lib/bb/ui/crumbs/hig.py b/lib/bb/ui/crumbs/hig.py
index 9adb281..402892e 100644
--- a/lib/bb/ui/crumbs/hig.py
+++ b/lib/bb/ui/crumbs/hig.py
@@ -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,9 +738,10 @@ 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 += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "; bash\""
- subprocess.Popen(args=shlex.split(cmdline))
+ cmdline = bb.ui.crumbs.utils.which_terminal()
+ if cmdline:
+ cmdline += "\"sudo dd if=" + self.image_path + " of=" + combo_item + "\""
+ subprocess.Popen(args=shlex.split(cmdline))
def update_progress_bar(self, title, fraction, status=None):
self.progress_bar.update(fraction)
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-11 1:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-10 22:20 [PATCH 2/2] hig/builder: use the new which_terminal() function Saul Wold
2012-04-10 22:54 ` Richard Purdie
2012-04-11 0:57 Saul Wold
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.