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

small update to pr 677 to tighten the regex #682

Merged
merged 4 commits into from Nov 12, 2019

Conversation

monkeyiq
Copy link
Contributor

Thanks to @peter- for PR 677 which found this issue and suggested a good solution to it. This is a slight update to #677 to make the regex more specific so that it can only match on the variable declaration line. I found that 677 would substitute on the line https://github.com/filesender/filesender/blob/master/scripts/client/filesender.py#L149 as well with unintended side effects. It is also tempting to use ^ and $ to limit the match scope but as the script is passed as a single string that would not match. Thus the fallback to using the newline to limit the match to only the variable declaration.

Maybe in the future we are better off building a map of configuration names that should be substituted and looping over that map doing a substitution of each configuration setting with a restrictive regex like the one in this PR. Such a solution would allow new config variables to be referenced without needing to tinker with regexes.

@monkeyiq monkeyiq merged commit 2a4808d into filesender:master Nov 12, 2019
fransward added a commit to fransward/filesender that referenced this pull request Nov 13, 2019
small update to pr 677 to tighten the regex (filesender#682)
peter- added a commit to peter-/filesender that referenced this pull request Apr 4, 2024
We've been here before 5 years ago when filesender#677 (and filesender#682) made parameter dynamic
when it was written into the Python CLI client itself.
Now do the same when we're writing this into a configuiration file for the
Python CLI client.
monkeyiq pushed a commit that referenced this pull request Apr 5, 2024
)

We've been here before 5 years ago when #677 (and #682) made parameter dynamic
when it was written into the Python CLI client itself.
Now do the same when we're writing this into a configuiration file for the
Python CLI client.
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.

None yet

2 participants