Merge pull request #2877 from pypeclub/bugfix/missing_time_function

General: Missing time function
This commit is contained in:
Jakub Trllo 2022-03-11 16:52:51 +01:00 committed by GitHub
commit 3cbc93d59c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 8 deletions

View file

@ -63,7 +63,10 @@ from .anatomy import (
Anatomy
)
from .config import get_datetime_data
from .config import (
get_datetime_data,
get_formatted_current_time
)
from .python_module_tools import (
import_filepath,
@ -309,6 +312,7 @@ __all__ = [
"Anatomy",
"get_datetime_data",
"get_formatted_current_time",
"PypeLogger",
"get_default_components",

View file

@ -26,7 +26,7 @@ class RenderInstance(object):
# metadata
version = attr.ib() # instance version
time = attr.ib() # time of instance creation (avalon.api.time())
time = attr.ib() # time of instance creation (get_formatted_current_time)
source = attr.ib() # path to source scene file
label = attr.ib() # label to show in GUI
subset = attr.ib() # subset name

View file

@ -74,3 +74,9 @@ def get_datetime_data(datetime_obj=None):
"S": str(int(seconds)),
"SS": str(seconds),
}
def get_formatted_current_time():
return datetime.datetime.now().strftime(
"%Y%m%dT%H%M%SZ"
)