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

Handle Relative Filepath #110

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
Open

Handle Relative Filepath #110

wants to merge 12 commits into from

Conversation

ceftanveer
Copy link
Collaborator

Fix for #104
-updated all the hardcoded paths in control files to relative paths.
-Added logic to read relative path, this will now work in all the environments, since its not dependent on absolute paths.
-After adding this logic, Errors related to relative paths are not seen in tests.

@ceftanveer ceftanveer requested a review from cefect January 15, 2025 18:04
base_dir = os.path.dirname(os.path.dirname(__file__))
parent_dir = os.path.dirname(base_dir)
fp = os.path.join(parent_dir, fp)
fp = os.path.join(self.cf_dir, fp)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cefect leveraged self.cf_dir to get base directory path and joined it with filepath.

@@ -2106,6 +2104,8 @@ def _par_hndl_chk(self,
assert isinstance(pval, str), '%s.%s expected a filepath '%(sect, varnm)
if pval == '':
raise Error('must provided a valid \'%s.%s\' filepath'%(sect, varnm))
if not os.path.exists(pval):
pval = os.path.join(self.cf_dir,pval)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@cefect here checking if the path is not valid then try to join it with base directory. even after this there is an assert statement so it will ensure the created path is valid. Adding this logic is producing correct paths and not showing errors in tests.

This reverts commit a59be76.
This reverts commit dbedfc1.
set relative path and add some notes
still failing test03 and test07
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

Successfully merging this pull request may close these issues.

3 participants