Cleaning
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
extends Control
|
||||
|
||||
const LESSON_EXERCICE_CONTAINER_SCENE: PackedScene = preload("res://sources/language_tool/lesson_exercises_container.tscn")
|
||||
const LESSON_EXERCISE_CONTAINER_SCENE: PackedScene = preload("res://sources/language_tool/lesson_exercises_container.tscn")
|
||||
|
||||
@onready var lessons_container: VBoxContainer = %LessonsContainer
|
||||
|
||||
@@ -42,7 +42,7 @@ func _ready() -> void:
|
||||
var sentences_by_lesson: Dictionary = Database.get_sentences_by_lessons()
|
||||
Database.db.query("Select * FROM Lessons")
|
||||
for result: Dictionary in Database.db.query_result:
|
||||
var container: LessonExerciceContainer = LESSON_EXERCICE_CONTAINER_SCENE.instantiate()
|
||||
var container: LessonExerciseContainer = LESSON_EXERCISE_CONTAINER_SCENE.instantiate()
|
||||
lessons_container.add_child(container)
|
||||
container.sentences_by_lesson = sentences_by_lesson
|
||||
container.lesson_number = result.LessonNb
|
||||
@@ -50,7 +50,7 @@ func _ready() -> void:
|
||||
|
||||
|
||||
func _on_save_button_pressed() -> void:
|
||||
for container: LessonExerciceContainer in lessons_container.get_children():
|
||||
for container: LessonExerciseContainer in lessons_container.get_children():
|
||||
container._on_save_button_pressed()
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
extends PanelContainer
|
||||
class_name LessonExerciceContainer
|
||||
class_name LessonExerciseContainer
|
||||
|
||||
@export var lesson_number: = -1:
|
||||
set = _set_lesson_number
|
||||
|
||||
@@ -557,7 +557,7 @@ func create_book() -> void:
|
||||
var file_path: String = lang_path.path_join(file_names[category])
|
||||
var file: FileAccess = FileAccess.open(file_path, FileAccess.READ)
|
||||
if file == null:
|
||||
Logger.error("ProfToolMenu: Erreur d'ouverture : " + file_path)
|
||||
Logger.error("ProfToolMenu: Error opening file: " + file_path)
|
||||
continue
|
||||
|
||||
if file.eof_reached():
|
||||
@@ -601,7 +601,7 @@ func create_book() -> void:
|
||||
|
||||
var values: PackedStringArray = parse_csv_line(line)
|
||||
if values.size() != raw_headers.size():
|
||||
Logger.warn("ProfToolMenu: Ligne malformée ignorée : %s" % values)
|
||||
Logger.warn("ProfToolMenu: Malformed line ignored: %s" % values)
|
||||
continue
|
||||
|
||||
var row_dict: Dictionary[String, String] = {}
|
||||
@@ -634,7 +634,7 @@ func create_book() -> void:
|
||||
var output_path: String = lang_path.path_join("booklet.csv")
|
||||
var output_file: FileAccess = FileAccess.open(output_path, FileAccess.WRITE)
|
||||
if output_file == null:
|
||||
Logger.error("ProfToolMenu: Impossible d'écrire : " + output_path)
|
||||
Logger.error("ProfToolMenu: Impossible to write: " + output_path)
|
||||
return
|
||||
|
||||
output_file.store_line(escape_csv_line(PackedStringArray(ordered_headers)))
|
||||
@@ -648,7 +648,7 @@ func create_book() -> void:
|
||||
|
||||
output_file.close()
|
||||
|
||||
error_label.text = "📘 Export des données du livret terminé vers : " + output_path
|
||||
error_label.text = "📘 Export data of the booklet finished to path: " + output_path
|
||||
Logger.trace("ProfToolMenu: " + error_label.text)
|
||||
|
||||
# Fonction qui ajoute une ligne au dictionnaire
|
||||
@@ -668,7 +668,7 @@ func add_row(dict: Dictionary[String, PackedStringArray], row_data: Dictionary[S
|
||||
dict[header] = filler
|
||||
dict[header].append(row_data.get(header, "") as String)
|
||||
|
||||
# Colonne spéciale : Categorie
|
||||
# Special column: "Categorie"
|
||||
if not dict.has("Categorie"):
|
||||
var filler: PackedStringArray
|
||||
filler.resize(current_size)
|
||||
@@ -732,8 +732,8 @@ func read_csv_record(file: FileAccess) -> String:
|
||||
record += line
|
||||
|
||||
var quote_count: int = 0
|
||||
for char: String in line:
|
||||
if char == "\"":
|
||||
for chara: String in line:
|
||||
if chara == "\"":
|
||||
quote_count += 1
|
||||
|
||||
open_quotes = (quote_count % 2 != 0)
|
||||
|
||||
Reference in New Issue
Block a user