fix indentation bug in add_execute_suggestions, some coding style
This commit is contained in:
parent
5276fa49ec
commit
4d1687c5c1
@ -654,13 +654,16 @@ class pluginclass(object):
|
|||||||
return
|
return
|
||||||
commands = user_text.split()
|
commands = user_text.split()
|
||||||
cmd = self.verify_command(commands[0])
|
cmd = self.verify_command(commands[0])
|
||||||
if cmd:
|
if not cmd:
|
||||||
|
return
|
||||||
text = "<b>%s</b>" % cgi.escape(text)
|
text = "<b>%s</b>" % cgi.escape(text)
|
||||||
commands[0] = cmd
|
commands[0] = cmd
|
||||||
if cmd.startswith("xdg-open"):
|
if cmd.startswith("xdg-open"):
|
||||||
self.add_suggestion("document-open", _("Try to open %s") % text, None, self.execute_user_input, commands, False)
|
self.add_suggestion("document-open", _("Try to open %s") % text,
|
||||||
|
None, self.execute_user_input, commands, False)
|
||||||
else:
|
else:
|
||||||
self.add_suggestion("application-x-executable", _("Run %s") % text, None, self.execute_user_input, commands, False)
|
self.add_suggestion("application-x-executable", _("Run %s") % text,
|
||||||
|
None, self.execute_user_input, commands, False)
|
||||||
self.applicationsBox.get_children()[-1].grab_focus()
|
self.applicationsBox.get_children()[-1].grab_focus()
|
||||||
|
|
||||||
def add_apt_filter_results(self, keyword):
|
def add_apt_filter_results(self, keyword):
|
||||||
@ -1088,8 +1091,7 @@ class pluginclass(object):
|
|||||||
IntegratedTerminal(command,
|
IntegratedTerminal(command,
|
||||||
_("mintMenu Integrated Terminal"),
|
_("mintMenu Integrated Terminal"),
|
||||||
width=self.integrated_terminal_width,
|
width=self.integrated_terminal_width,
|
||||||
height=self.integrated_terminal_height
|
height=self.integrated_terminal_height)
|
||||||
)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("IntegratedTerminal exception:", e)
|
print("IntegratedTerminal exception:", e)
|
||||||
hasVte = False
|
hasVte = False
|
||||||
|
@ -20,8 +20,8 @@ class IntegratedTerminal(Gtk.Window):
|
|||||||
self.ready = False
|
self.ready = False
|
||||||
self.output_handler = self.terminal.connect("cursor-moved",
|
self.output_handler = self.terminal.connect("cursor-moved",
|
||||||
self.on_cursor_moved)
|
self.on_cursor_moved)
|
||||||
# apparently Vte.Terminal.spawn_sync() is deprecated in favour of the
|
# apparently Vte.Terminal.spawn_sync() is deprecated in favour of
|
||||||
# non-existent Vte.Terminal.spawn_async()...
|
# the non-existent Vte.Terminal.spawn_async()...
|
||||||
self.terminal.spawn_sync(
|
self.terminal.spawn_sync(
|
||||||
Vte.PtyFlags.DEFAULT, # pty_flags
|
Vte.PtyFlags.DEFAULT, # pty_flags
|
||||||
cwd or os.environ.get("HOME"), # working_directory
|
cwd or os.environ.get("HOME"), # working_directory
|
||||||
@ -81,11 +81,11 @@ class IntegratedTerminal(Gtk.Window):
|
|||||||
if not line.lstrip(prefix):
|
if not line.lstrip(prefix):
|
||||||
# we got a command prompt, exit
|
# we got a command prompt, exit
|
||||||
self.exit()
|
self.exit()
|
||||||
break
|
return
|
||||||
# the command generated output, show the terminal
|
# the command generated output, show the terminal
|
||||||
terminal.disconnect(self.output_handler)
|
terminal.disconnect(self.output_handler)
|
||||||
self.show_all()
|
self.show_all()
|
||||||
break
|
return
|
||||||
if self.command in line:
|
if self.command in line:
|
||||||
# this is our command line
|
# this is our command line
|
||||||
prefix = line.split(self.command, 1)[0]
|
prefix = line.split(self.command, 1)[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user