02-23-2020, 12:38 PM
(02-21-2020, 03:28 PM)remkonoteboom Wrote: The function that handles this is "naming_to_dir()" in the file "src/pyasm/biz/naming.py". If you look at the function, it will check to see if the value in the parenthesis either starts with a $ or @ and assumes an expression. It will then go through the overhead of parsing the expression which has some overhead. If not, it goes through a bunch of "if" statements to evaluate things like "sobject.code" directly (which is much faster).I found the solution how to avoid editing tactic sources, and using TEL.
There is script_path in file_naming.py!
This is really handy and portable, also almost 3x faster than my TEL variant.
Example code:
Code:
sobject = input['sobject'].get_value
snapshot = input['snapshot'].get_value
file_object = input['file_object'].get_value
parent = input['sobject'].get_parent()
version = int(snapshot('version'))
if version in [-1, 0]:
version = None
if input.get('ext'):
if version:
return u'ITSFILE_{0:03}'.format(version)
else:
return u'ITSFILE_versionless'
else:
if file_object('type') == 'web':
return u'ITSDIR/__preview/web'
elif file_object('type') == 'icon':
return u'ITSDIR/__preview/icon'
else:
return u'ITSDIR'
It's sad i didn't found it earlier