Skip to content
Snippets Groups Projects
Commit b81f0653 authored by Toumji Abdallah's avatar Toumji Abdallah
Browse files

Implemented the creation of text files

parent 5ad6c8e9
No related branches found
No related tags found
No related merge requests found
...@@ -147,7 +147,7 @@ class Application(tk.Frame): ...@@ -147,7 +147,7 @@ class Application(tk.Frame):
self.form_handler.show_forms(0) self.form_handler.show_forms(0)
self.confirm_button.config(text='Confirm', command=self.next_step, state='disabled') self.confirm_button.config(text='Confirm', command=self.next_step, state='disabled')
if '.md' in self.form_handler.form_frame_list[0].form[0]: if '.md' in self.form_handler.form_frame_list[0].form[0] or '.' not in self.form_handler.form_frame_list[0].form[0]:
self.confirm_button.config(state='normal') self.confirm_button.config(state='normal')
self.form_handler.frame.winfo_toplevel().bind('<<EntryStateChanged>>', lambda *_: self.check_mandatory( self.form_handler.frame.winfo_toplevel().bind('<<EntryStateChanged>>', lambda *_: self.check_mandatory(
......
...@@ -33,6 +33,8 @@ class Form: ...@@ -33,6 +33,8 @@ class Form:
self.create_form_tsv() self.create_form_tsv()
elif '.md' in self.form[0]: elif '.md' in self.form[0]:
self.create_form_md() self.create_form_md()
else:
self.create_form_no_extension()
def create_form_json(self): def create_form_json(self):
self.entries = EntryManager.create_entry_from_json(self.form, self.frame, self.help_icon) self.entries = EntryManager.create_entry_from_json(self.form, self.frame, self.help_icon)
...@@ -49,6 +51,16 @@ class Form: ...@@ -49,6 +51,16 @@ class Form:
'To learn more about markdown, visit this link: https://www.markdownguide.org/basic-syntax/') 'To learn more about markdown, visit this link: https://www.markdownguide.org/basic-syntax/')
self.entries.append(text_entry) self.entries.append(text_entry)
def create_form_no_extension(self):
text_entry = tk.Text(self.frame, height=10, width=50)
text_entry.grid(row=self.current_row, column=0, columnspan=5, rowspan=10)
self.current_row += 10
help_label = tk.Label(self.frame, image=self.help_icon)
help_label.grid(row=self.current_row, column=3)
CreateToolTip(help_label, self.form[0]["description"])
self.entries.append(text_entry)
def is_valid_mandatory(self): def is_valid_mandatory(self):
if '.md' in self.form[0]: if '.md' in self.form[0]:
return True return True
...@@ -92,6 +104,8 @@ class Form: ...@@ -92,6 +104,8 @@ class Form:
return False return False
self.validation_label.config(image=self.valid_icon) self.validation_label.config(image=self.valid_icon)
return True return True
else:
return True
def save_form(self, path): def save_form(self, path):
if '.json' in self.form[0]: if '.json' in self.form[0]:
......
...@@ -143,11 +143,12 @@ ...@@ -143,11 +143,12 @@
"linked_file": "participants.tsv" "linked_file": "participants.tsv"
}, },
"README.md" : { "README.md" : {
"Description" : { "description" : "A text file that provides a general overview of the dataset. This file should be written in Markdown format."
"requirement level" : "recommended", },
"multiple" : false, "CHANGES" : {
"description" : "Description of the dataset", "description" : "A text file that provides a chronological list of changes to the dataset."
"valid condition": "len(value) > 0" },
} "LICENSE" : {
"description" : "A text file that provides the full license text for the dataset."
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment