Skip to content

read the bat file to set up the process environment - #229

Merged
arun3688 merged 1 commit into
OpenModelica:masterfrom
arun3688:batfile
Nov 11, 2024
Merged

read the bat file to set up the process environment#229
arun3688 merged 1 commit into
OpenModelica:masterfrom
arun3688:batfile

Conversation

@arun3688

Copy link
Copy Markdown
Collaborator

Purpose

This PR reads the generated .bat file to set up the process environment which includes all external dependencies of the model.

@arun3688
arun3688 requested a review from adeas31 November 11, 2024 09:35

@adeas31 adeas31 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread OMPython/__init__.py
## set the process environment from the generated .bat file in windows which should have all the dependencies
batFilePath = os.path.join(self.tempdir, '{}.{}'.format(self.modelName, "bat")).replace("\\", "/")
if (not os.path.exists(batFilePath)):
print("Error: bat does not exist " + batFilePath)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can change this to logging once PR #228 is merged.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@adeas31 sure

@syntron syntron Nov 11, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be an IOError? - if the *.bat file does not exists there is something wrong ...

@arun3688
arun3688 merged commit dbe2119 into OpenModelica:master Nov 11, 2024
@arun3688
arun3688 deleted the batfile branch November 11, 2024 11:29
@syntron syntron mentioned this pull request Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants