Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyDMShellCommand bash option #1045

Merged
merged 13 commits into from
Nov 7, 2023

Conversation

nstelter-slac
Copy link
Collaborator

@nstelter-slac nstelter-slac commented Oct 26, 2023

allow for Bash features in PyDMShellCommand cmd such as command chaining ("command1; command2")

also add example that shows 2 alternative ways to use Bash through PyDMShellCommand widget.

@klauer
Copy link
Collaborator

klauer commented Oct 27, 2023

A few things:

  • It's not really bash though, at least not necessarily:
In [2]: subprocess.call('echo $0', shell=True)
/bin/sh
image

ref

  • It's perhaps also worth a warning somewhere that globs, variables, etc, will be expanded.
  • I'm personally a fan of distributing small shell scripts alongside PyDM screens as they can be used externally, though I do see the utility here.
  • For the designer, it'd be really nice if the shell command could have its own multi-line text edit widget so that you specifically don't have to chain; commands; together; in an unreadable fashion

…erence Bash

Since shell=true does not necessarily run cmds through a Bash shell
always
Copy link
Collaborator

@jbellister-slac jbellister-slac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! I like the new example, just a few minor comments below

examples/shell_command/shell_command_full_shell.ui Outdated Show resolved Hide resolved
pydm/widgets/shell_command.py Outdated Show resolved Hide resolved
@jbellister-slac jbellister-slac merged commit 94f92de into slaclab:master Nov 7, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants