Доработка. Улучшение документации.

This commit is contained in:
lepshiy
2024-07-25 16:10:22 +03:00
parent bae7a949e4
commit d826f8745c
47 changed files with 3607 additions and 3507 deletions

View File

@@ -9,30 +9,30 @@ var FILES_ROWS_ALIGNMENT = [ HORIZONTAL_ALIGNMENT_LEFT, HORIZONTAL_ALIGNM
func fill_files_table(tbl: table, folder: String, rows_types: Array):
var dir: = DirAccess.open(folder)
if dir == null:
return
var files: = []
var exclude_names: = ['.', '..']
dir.list_dir_begin() # TODOGODOT4 fill missing arguments https://github.com/godotengine/godot/pull/40547
while true:
var file: = dir.get_next()
if file == '':
break
if file in exclude_names:
continue
var file_name = folder + '/' + file
var fd = FileAccess.open(file_name, FileAccess.READ)
if not fd:
continue
var glob_path = ProjectSettings.globalize_path(file_name)
var sz = fd.get_length()
var ut = fd.get_modified_time(file_name)
fd.close()
var mt = Time.get_datetime_dict_from_unix_time(ut)
var file_row = [file, '%d' % sz, '%d-%02d-%02d %02d:%02d' % [mt.year, mt.month, mt.day, mt.hour, mt.minute]]
tbl.add_row(rows_types)
var i_row = tbl.get_rows_count() - 1
tbl.set_row_text(i_row, file_row)
tbl.set_node_meta(0, i_row, 'file_path', glob_path)
dir.list_dir_end()
var dir: = DirAccess.open(folder)
if dir == null:
return
var files: = []
var exclude_names: = ['.', '..']
dir.list_dir_begin() # TODOGODOT4 fill missing arguments https://github.com/godotengine/godot/pull/40547
while true:
var file: = dir.get_next()
if file == '':
break
if file in exclude_names:
continue
var file_name = folder + '/' + file
var fd = FileAccess.open(file_name, FileAccess.READ)
if not fd:
continue
var glob_path = ProjectSettings.globalize_path(file_name)
var sz = fd.get_length()
var ut = fd.get_modified_time(file_name)
fd.close()
var mt = Time.get_datetime_dict_from_unix_time(ut)
var file_row = [file, '%d' % sz, '%d-%02d-%02d %02d:%02d' % [mt.year, mt.month, mt.day, mt.hour, mt.minute]]
tbl.add_row(rows_types)
var i_row = tbl.get_rows_count() - 1
tbl.set_row_text(i_row, file_row)
tbl.set_node_meta(0, i_row, 'file_path', glob_path)
dir.list_dir_end()