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

Feature Request: ability to use parse_list_line_custom only as a fallback solution #145

Closed
spolloni opened this issue Oct 27, 2021 · 4 comments

Comments

@spolloni
Copy link

spolloni commented Oct 27, 2021

somewhat related to issues 104 and 144

I was wondering if there is any interest in implementing a "fallback" list line parser.

Currently, any callable passed as parse_list_line_custom will take precedence over parse_list_line_unix and parse_list_line_windows. However, for client code dealing with the "occasional" odd server that requires a custom parser, I much rather define a "fallback" parser used in last resort than ALWAYS overriding the built in parsers.

Here is an implementation of this, but alternatively maybe a 'last'/'first' argument could be used to tell the Client in what order to use the custom parser.

@pohmelie
Copy link
Collaborator

I got your point, but is there something wrong with just raising a ValueError if your custom parser don't understand the line and want to try unix and windows parsers instead?

@spolloni
Copy link
Author

spolloni commented Dec 7, 2021

the problem is that oftentimes the custom parser WILL understand the line, but I would prefer to use self.parse_list_line_unix or self.parse_list_line_windows when they work.

@pohmelie
Copy link
Collaborator

I add parse_list_line_custom_first argument, will release new version soon.

@spolloni
Copy link
Author

thanks!

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

No branches or pull requests

2 participants