Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Set SVG_DIRS with environ #6

Answered by xshapira
jasonleex asked this question in Q&A
Discussion options

You must be logged in to vote

To set the SVG_DIRS variable, you can first define your ROOT_DIR using the environ.Path like so:

# Build paths inside the project like this: str(ROOT_DIR("subdir"))
ROOT_DIR = environ.Path(__file__) - 3

This will create a Path object representing the directory three levels above the current file. Note that the number of levels may vary depending on your file structure.

Once you have defined your ROOT_DIR, you can set SVG DIRS like this:

SVG_DIRS = [str(ROOT_DIR("dist/img/svg"))]

This will set SVG_DIRS to a list containing the svg directory located in dist/img relative to the ROOT_DIR.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jasonleex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants