-
Notifications
You must be signed in to change notification settings - Fork 19
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
cirrus module: exposed some Starlib builtins and added an env dict #96
Conversation
pkg/larker/loader/loader.go
Outdated
"http": starlibModules["http"], | ||
"hash": starlibModules["hash"], | ||
"json": starlibModules["json"], | ||
"yaml": starlibModules["yaml"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add zipfile
, re
and `base64. Can do here or in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 40d9ac2.
pkg/larker/loader/loader.go
Outdated
return starlark.StringDict{ | ||
"fs": &starlarkstruct.Module{ | ||
Name: "fs", | ||
Members: builtin.FS(loader.ctx, loader.fs), | ||
}, | ||
"env": starlarkEnv, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems we can rename starlibModules
to builtinModules
and then do something like:
builtinModules["fs"] = ...
builtinModules["env"] = ...
return builtinModules
This way there is no need for duplicated "http"
, "hash"
, etc. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 9645b04.
See #53.