Your suggestion to transformed "\n" to "
" sounds good to me.
Although, I actually have no idea what the correct policy should be
on this. If you have a rational, I'd be interested.
I added a line to generateDS.py that replaces "\n" with "
".
Hope I got it right.
Attached is a patch.
Please let me know whether this is what you intended and whether it
works for you. If it works, I'll create a new release.
However, I do have a question:
In the source of generateDS.py I find s1 = s1.replace(r'\\n', ' '). In any other source file of your project, however, I find s1 = s1.replace(r'\n', ' '). Why this difference?
When I run generateDS on my schema the resulting Super.py contains s1 = s1.replace(r'\n', ' ')
Here's what I found out:
- s1 = s1.replace(r'\n', ' ') would work for a string like the following s1 = 'test\\ntest'
- s1 = s1.replace(r'\n', ' ') would NOT work for a string like the following (containing a real line break) s1 = 'test\ntest'. Here s1 = s1.replace('\n', ' ') would work. This would cover my use case.
Thank you.
Gabriel
Last edit: Gabriel Kleinoscheg 2022-05-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
With this patch, generateDS.py produces the following line in the generated module:
s1 = s1.replace('\n', ' ')
I'm actually unsure about what it is supposed to do. So, I'll wait for you to tell me that it works and solves your problem before I upload another release.
Thanks for your very helpful and explicit description of a solution. Hope I got it right this time.
Gabriel,
Thanks for the note.
Your suggestion to transformed "\n" to " " sounds good to me.
Although, I actually have no idea what the correct policy should be
on this. If you have a rational, I'd be interested.
I added a line to
generateDS.py
that replaces "\n" with " ".Hope I got it right.
Attached is a patch.
Please let me know whether this is what you intended and whether it
works for you. If it works, I'll create a new release.
Thanks for help.
Dave
Gabriel,
I've created a new release: v. 2.40.11. It has been uploaded to sourceforge.net and to pypi.org.
Thanks for your help with this.
Dave
Dave,
thank you for the quick response and implementation.
I still owe you some explanation about this - the best I found is here https://stackoverflow.com/questions/514635/represent-space-and-tab-in-xml-tag
I hope that helps.
Thank you!
Gabriel
Dave,
I just got aware of the fact that you added the following line:
s1 = s1.replace(r'\\n', ' ')
What would be the difference to the following line:
s1 = s1.replace('\n', ' ')
Taking the test here - only
s2
contains the correct output (with
):Regards,
Gabriel
Concerning your question about what is the difference between the following two lines?
Try running the following:
Thanks for the link to the StackOverflow page. Yes, that is informative and is a good explanation.
So, did that latest version (v. 2.40.11) fix things for you?
Dave
Unfortunately, no.
However, I do have a question:
In the source of
generateDS.py
I finds1 = s1.replace(r'\\n', ' ')
. In any other source file of your project, however, I finds1 = s1.replace(r'\n', ' ')
. Why this difference?When I run generateDS on my schema the resulting Super.py contains
s1 = s1.replace(r'\n', ' ')
Here's what I found out:
-
s1 = s1.replace(r'\n', ' ')
would work for a string like the followings1 = 'test\\ntest'
-
s1 = s1.replace(r'\n', ' ')
would NOT work for a string like the following (containing a real line break)s1 = 'test\ntest'
. Heres1 = s1.replace('\n', ' ')
would work. This would cover my use case.Thank you.
Gabriel
Last edit: Gabriel Kleinoscheg 2022-05-05
OK. So, attached is another patch.
With this patch,
generateDS.py
produces the following line in the generated module:I'm actually unsure about what it is supposed to do. So, I'll wait for you to tell me that it works and solves your problem before I upload another release.
Thanks for your very helpful and explicit description of a solution. Hope I got it right this time.
Dave
Hey,
yes, that looks good.
Thank you for your effort!
Regard,
Gabriel
Great,
That patch has now been uploaded as v. 2.40.12.
Thanks again.
Dave