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

replicate the unix(command) #234

Closed
3 tasks done
prjemian opened this issue Aug 24, 2019 · 2 comments · Fixed by #248
Closed
3 tasks done

replicate the unix(command) #234

prjemian opened this issue Aug 24, 2019 · 2 comments · Fixed by #248
Assignees
Milestone

Comments

@prjemian
Copy link
Contributor

prjemian commented Aug 24, 2019

This is useful when converting SPEC macros, such as implemented for APS 8-ID-I

  • confirm it is running on a unix system
  • use logging package
  • log any error output
@prjemian prjemian added this to the 1.1.14 milestone Aug 24, 2019
@prjemian prjemian self-assigned this Aug 24, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
@prjemian
Copy link
Contributor Author

prjemian commented Sep 3, 2019

Hmmm... Seems there already exists such a command, but with basic features. Also returns stderr.

apstools/apstools/utils.py

Lines 572 to 576 in 51b147f

def unix_cmd(command_list):
"""run a UNIX command, returns (stdout, stderr)"""
process = subprocess.Popen(command_list, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()
return stdout, stderr

Let's deprecate that command in favor of the new one. Why? New one has same name and call signature as counterpart in SPEC. Also, less likely to be overlooked. Again.

prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
@prjemian
Copy link
Contributor Author

prjemian commented Sep 3, 2019

Needs unit tests

prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
prjemian added a commit that referenced this issue Sep 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant