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

Model get double line breaker when editing model #90

Open
jules-l-jimmy opened this issue Jul 19, 2024 · 0 comments
Open

Model get double line breaker when editing model #90

jules-l-jimmy opened this issue Jul 19, 2024 · 0 comments

Comments

@jules-l-jimmy
Copy link

jules-l-jimmy commented Jul 19, 2024

Hi,

Platform : Windows

I am using modelica-builder to edit some values in my model and I have an issue:
Every line break is doubled. Therefore after edits I get something like this:

  package mediumA = Modelica.Media.Air.MoistAir;

  package mediumB = Modelica.Media.Air.MoistAir;

  import Modelica.Constants.pi;

instead of

  package mediumA = Modelica.Media.Air.MoistAir;
  package mediumB= Modelica.Media.Air.MoistAir;
  import Modelica.Constants.pi;

Reading the code, it seems to be related to the way the line breaker are handled in Windows.

I have replaced in model.py, save_as function :

        with open(filename, 'wt', newline='') as f:
            f.write(result)

with

        with open(filename, 'wt', newline='\n') as f:
            f.write(result)

And it works

Do you think this can be incorporated in the code ?
As this issue is probably only on windows, how do you think you can handle windows machines ?

Best

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

1 participant