forked from dinoboff/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 2
Merge Changes Upstream? #1
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
Open
rsyring
wants to merge
31
commits into
yappari:master
Choose a base branch
from
locationlabs:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…prompt.
This feature allows a skeleton to be constructed with a longer list of
variable prompts without necesssarily requiring the user to painfully
input every answer. For example, a template to generate a default python
project could use the same value of its project name and main package name
without typing both -- or could support different values.
There are two main changes here:
- Var instances get assigned a reference to the calling skeleton ('owner')
before prompt() is called. This allows the Var to call back into the
skeleton to query what other values have been set without requiring Var
instances to know about each other or save state. This reference is
cleared after prompt() returns.
- Var.default is now a property so its getter can be overridden nicely
in the DependentVar subclass.
Validator simply takes over the responsibility formerly in Var.validate(),
which now delegates to a validator instance. Var is instantiated with a
default Validator if none is provided.
RegexValidator takes a pattern as input and validates that the user's
input matches the pattern, raising an error if none.
Example:
variables = [
Var('foo',validator=RegexValidator('[a-z]+'))
]
- Formatting now uses a formatter class - StringFormatter remains the default - JinjaFormatter may be used trivially by setting 'use_jinja'
As described in the pocoo-libs thread "Bug in jinja2.lexer", https://groups.google.com/forum/?fromgroups=#!topic/pocoo-libs/6DylMqq1voI Jinja normalizes newlines in a manner that loses a newline at the end of a file. Add a check for the trailing newline in a template to be rendered by JinjaFormatter and add an extra newline to preserve the original in the output.
Forgot to update tests to reflect my preceding change
automated builds.
By delaying the file open, you can read the existing file
…leton into hfinucane-template-inheritance
Environment plumbing
Allow loading from non-cwd destination directory
Tests pass now
Set __dst_dir__ in write() instead of cmd()
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Can these changes get merged upstream and get them released to pypi?
Thanks.