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

pathlib - OS agnostic Python methods for handling configuration files. #10

Open
aiqc opened this issue Mar 20, 2021 · 0 comments
Open
Labels
refactor Make code more modular/efficient or change schema.

Comments

@aiqc
Copy link
Owner

aiqc commented Mar 20, 2021

Difficulty: ★★☆☆☆ (cross OS testing)

Background

AIQC works on Mac, Linux, Windows. Managing local files can be a pain across different operating systems as they don't all use bash or they use 'backward/no trailing' slash versus 'forward/trailing' slash.

Problem

In some cases, Python-based OS-agnostic methods like os.makedirs() are used. However, in other situations, we are still using cmd_file_create = 'echo "test" >> ' + app_dir + file_name.
The Python methods were written for this use case, so we should use them!

Solution

Go through the lines of code related to configuration file and database creation and convert manual sys commands to Python based commands wherever possible. Decide if we should switch to using: https://docs.python.org/3/library/pathlib.html

Must test any changes across Windows, Mac, and Linux.

@aiqc aiqc added the feature label Mar 20, 2021
@aiqc aiqc changed the title OS agnostic Python methods for handling configuration files. pathlib - OS agnostic Python methods for handling configuration files. Apr 1, 2021
@aiqc aiqc added refactor Make code more modular/efficient or change schema. and removed feature labels Apr 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Make code more modular/efficient or change schema.
Projects
None yet
Development

No branches or pull requests

1 participant