-
Notifications
You must be signed in to change notification settings - Fork 4
Make sure old files are not picked up and add regex to search log output #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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1 +/- ##
=======================================
Coverage ? 98.73%
=======================================
Files ? 2
Lines ? 316
Branches ? 0
=======================================
Hits ? 312
Misses ? 4
Partials ? 0 |
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.
Some (untested) changes suggested to remove the global variable.
@pnuu I think I addressed your comments. |
Ok, this supports now regexes also. |
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.
LGTM, just one suggested simplification.
pub.send(message) | ||
|
||
|
||
def generate_message_from_log_output(publisher_config, mda, log_output): | ||
"""Generate message for the filenames present in the log output.""" | ||
new_files = re.findall(publisher_config["output_files_log_regex"], str(log_output)) |
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.
So if there's a regex pattern in the config, the output from the called script is parsed to catch the filenames? Handy.
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.
yes exactly.
Co-authored-by: Panu Lahtinen <[email protected]>
This PR saves the state of the directory to make sure only new files are picked.
Also adds the possibility to use a configured regex to parse new filenames from the script log.