Skip to content

Commit a399bdf

Browse files
author
Jackson
committed
commented for future reference
1 parent eaae648 commit a399bdf

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/classes/assets.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,21 @@ def get_assets_path(file_path=None, create_paths=True):
3737
return info.USER_PATH
3838

3939
try:
40-
# Generate asset folder name, max 30 chars of filename + "_assets"
40+
# Generate asset folder name filename + "_assets"
4141
file_path = file_path
4242
asset_filename = os.path.splitext(os.path.basename(file_path))[0]
4343
asset_folder_name = asset_filename + "_assets"
44-
asset_folder_name_30_char = asset_filename[:30] + "_assets"
4544
asset_path = os.path.join(os.path.dirname(file_path), asset_folder_name)
46-
asset_path_30_char = os.path.join(os.path.dirname(file_path), asset_folder_name_30_char)
47-
4845

46+
# Previous Assets File Name Convention.
47+
asset_folder_name_30_char = asset_filename[:30] + "_assets"
48+
asset_path_30_char = os.path.join(os.path.dirname(file_path), asset_folder_name_30_char)
4949

5050
# Create asset folder, if necessary
5151
if create_paths:
5252

5353
if os.path.exists(asset_path_30_char):
54+
#update assets folder, if it follows the previous naming convention
5455
os.rename(asset_path_30_char, asset_path)
5556
log.info("Updating 30 character path to full length {}".format(asset_path))
5657
elif not os.path.exists(asset_path):

0 commit comments

Comments
 (0)