-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4398 from ynput/feature/OP-3663_Hiero-export-of-l…
…arge-number-of-shots-fill-up-disk
- Loading branch information
Showing
6 changed files
with
144 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
""" | ||
Temporary folder operations | ||
""" | ||
|
||
import os | ||
from openpype.lib import StringTemplate | ||
from openpype.pipeline import Anatomy | ||
|
||
|
||
def create_custom_tempdir(project_name, anatomy=None): | ||
""" Create custom tempdir | ||
Template path formatting is supporting: | ||
- optional key formatting | ||
- available keys: | ||
- root[work | <root name key>] | ||
- project[name | code] | ||
Args: | ||
project_name (str): project name | ||
anatomy (openpype.pipeline.Anatomy)[optional]: Anatomy object | ||
Returns: | ||
str | None: formatted path or None | ||
""" | ||
openpype_tempdir = os.getenv("OPENPYPE_TMPDIR") | ||
if not openpype_tempdir: | ||
return | ||
|
||
custom_tempdir = None | ||
if "{" in openpype_tempdir: | ||
if anatomy is None: | ||
anatomy = Anatomy(project_name) | ||
# create base formate data | ||
data = { | ||
"root": anatomy.roots, | ||
"project": { | ||
"name": anatomy.project_name, | ||
"code": anatomy.project_code, | ||
} | ||
} | ||
# path is anatomy template | ||
custom_tempdir = StringTemplate.format_template( | ||
openpype_tempdir, data).normalized() | ||
|
||
else: | ||
# path is absolute | ||
custom_tempdir = openpype_tempdir | ||
|
||
# create the dir path if it doesn't exists | ||
if not os.path.exists(custom_tempdir): | ||
try: | ||
# create it if it doesn't exists | ||
os.makedirs(custom_tempdir) | ||
except IOError as error: | ||
raise IOError( | ||
"Path couldn't be created: {}".format(error)) from error | ||
|
||
return custom_tempdir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
--- | ||
id: admin_environment | ||
title: Environment | ||
sidebar_label: Environment | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
## OPENPYPE_TMPDIR: | ||
- Custom staging dir directory | ||
- Supports anatomy keys formatting. ex `{root[work]}/{project[name]}/temp` | ||
- supported formatting keys: | ||
- root[work] | ||
- project[name | code] | ||
|
||
## OPENPYPE_DEBUG | ||
- setting logger to debug mode | ||
- example value: "1" (to activate) | ||
|
||
## OPENPYPE_LOG_LEVEL | ||
- stringified numeric value of log level. [Here for more info](https://docs.python.org/3/library/logging.html#logging-levels) | ||
- example value: "10" | ||
|
||
## OPENPYPE_MONGO | ||
- If set it takes precedence over the one set in keyring | ||
- for more details on how to use it go [here](admin_use#check-for-mongodb-database-connection) | ||
|
||
## OPENPYPE_USERNAME | ||
- if set it overides system created username |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters