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

Export stack when run as script #83

Open
garyd203 opened this issue Dec 29, 2017 · 0 comments
Open

Export stack when run as script #83

garyd203 opened this issue Dec 29, 2017 · 0 comments
Labels

Comments

@garyd203
Copy link
Owner

garyd203 commented Dec 29, 2017

Have some magic convenience functionality that allows you to execute a python file as a module, and it will automatically export the Stack it contains to stdout as yaml. eg.

python mystack.py > mystack.yaml

Some guidelines for expected behaviour:

  • module contains exactly one Stack instance, assigned to a global variable
  • module does not contain some other script-like executable code

Some possible implementation ideas:

  • When you instantiate a stack, it checks whether it's locals() are the same as it's globals(), and if it's __name__ is __main__, then injects some code into globals to execute itself.
@garyd203 garyd203 added this to the beta-release milestone Dec 29, 2017
@garyd203 garyd203 modified the milestones: beta-release, v1-release Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant