Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DEVX-5006] Add input parameter to 'gather' and coerce language format. #353

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

Merged
merged 2 commits into from
Jun 16, 2017

Conversation

jmctwilio
Copy link
Contributor

No description provided.

@jmctwilio jmctwilio requested review from dougblack, jingming, a user, ilanbiala and codejudas June 13, 2017 19:32
hints=hints,
barge_in=barge_in,
acknowledge_sound_url=acknowledge_sound_url,
input=input,
Copy link
Contributor

Choose a reason for hiding this comment

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

input is a builtin function, so this might cause some trouble. Did these tests pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They did. While it's a built-in function, it's not reserved like "from". One could argue that there's potential that overwriting the value of input in this scope could cause errors; but, I seriously doubt it would. Happy to change it to "input_" if that's a preferred strategy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Leaving this alone will be fine in practice thanks to scoping.

if not language:
return language

if not re.match('^\w\w[_-]\w\w$', language):
Copy link
Contributor

Choose a reason for hiding this comment

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

\w matches words. It seems like we might want to match letters here? Like with [a-z] or [A-Z].

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fair. Since we're not validating that the string is an actual language specifier that's supported, we'd still be relying on the API to respond with an error if someone input something that was slightly wrong. The regex was mostly there to check that things look mostly right. Accepting digits and underscores didn't seem to be too far removed from the goal of just being a bit helpful.

hints=hints,
barge_in=barge_in,
acknowledge_sound_url=acknowledge_sound_url,
input=input,
Copy link
Contributor

Choose a reason for hiding this comment

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

Leaving this alone will be fine in practice thanks to scoping.

@dougblack dougblack merged commit cea9fab into master Jun 16, 2017
@ilanbiala ilanbiala deleted the DEVX-5006_update_gather_twiml branch June 18, 2017 01:49
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