From 4059d0c095df544cedd2806de918cb36893dc065 Mon Sep 17 00:00:00 2001 From: Berkay Gediz <121058050+berkaygediz@users.noreply.github.com> Date: Tue, 19 Dec 2023 23:03:50 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RichSpan.py | 99 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 66 insertions(+), 33 deletions(-) diff --git a/RichSpan.py b/RichSpan.py index 70db9dd..48a2cd0 100644 --- a/RichSpan.py +++ b/RichSpan.py @@ -520,21 +520,31 @@ def RS_updateStatistics(self): statistics += "" statistics += "" if word_count > 0 and line_count > 0 and character_count > 0 and page_count > 0 and text != "": - statistics += f"" + statistics += f"" avg_word_length = sum(len(word) for word in text.split()) / word_count - statistics += f"" + statistics += f"" avg_line_length = character_count / line_count - 1 - statistics += f"" + statistics += f"" uppercase_count = sum(1 for char in text if char.isupper()) lowercase_count = sum(1 for char in text if char.islower()) - statistics += f"" - statistics += f"" - statistics += f"" - statistics += f"" - statistics += f"" - statistics += f"" - statistics += f"" + statistics += f"" + statistics += f"" + statistics += f"" + statistics += f"" + statistics += f"" + statistics += f"" + statistics += f"" statistics += "" statistics += "
{translations[settings.value('current_language')]['analysis']}{translations[settings.value( + 'current_language')]['analysis']}{translations[settings.value('current_language')]['analysis_message_1'].format(avg_word_length)}{translations[settings.value( + 'current_language')]['analysis_message_1'].format(avg_word_length)}{translations[settings.value('current_language')]['analysis_message_2'].format(avg_line_length)}{translations[settings.value( + 'current_language')]['analysis_message_2'].format(avg_line_length)}{translations[settings.value('current_language')]['analysis_message_3'].format(uppercase_count)}{translations[settings.value('current_language')]['analysis_message_4'].format(lowercase_count)}{translations[settings.value('current_language')]['statistic']}{translations[settings.value('current_language')]['statistic_message_1'].format(line_count)}{translations[settings.value('current_language')]['statistic_message_2'].format(word_count)}{translations[settings.value('current_language')]['statistic_message_3'].format(character_count)}{translations[settings.value('current_language')]['statistic_message_4'].format(page_count)}{translations[settings.value( + 'current_language')]['analysis_message_3'].format(uppercase_count)}{translations[settings.value( + 'current_language')]['analysis_message_4'].format(lowercase_count)}{translations[settings.value( + 'current_language')]['statistic']}{translations[settings.value( + 'current_language')]['statistic_message_1'].format(line_count)}{translations[settings.value( + 'current_language')]['statistic_message_2'].format(word_count)}{translations[settings.value( + 'current_language')]['statistic_message_3'].format(character_count)}{translations[settings.value( + 'current_language')]['statistic_message_4'].format(page_count)}RichSpan
" @@ -774,27 +784,48 @@ def RS_setupDock(self): "th {background-color: #4CAF50; color: white;}" "" "" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" - f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" + f"" "
{translations[settings.value('current_language')]['help_shortcut']}{translations[settings.value('current_language')]['help_description']}
Ctrl+N{translations[settings.value('current_language')]['new_message']}
Ctrl+O{translations[settings.value('current_language')]['open_message']}
Ctrl+S{translations[settings.value('current_language')]['save_message']}
Ctrl+Shift+S{translations[settings.value('current_language')]['save_as_message']}
Ctrl+P{translations[settings.value('current_language')]['print_message']}
Ctrl+Z{translations[settings.value('current_language')]['undo_message']}
Ctrl+Y{translations[settings.value('current_language')]['redo_message']}
Ctrl+Shift+V{translations[settings.value('current_language')]['viewmode_message']}
Ctrl+Shift+T{translations[settings.value('current_language')]['darklight_message']}
Ctrl+Shift+D{translations[settings.value('current_language')]['help_message']}
Ctrl+Shift+C{translations[settings.value('current_language')]['font_color_message']}
Ctrl+Shift+B{translations[settings.value('current_language')]['background_color_message']}
Ctrl+Shift+F{translations[settings.value('current_language')]['font_message']}
Ctrl++{translations[settings.value('current_language')]['inc_font_message']}
Ctrl+-{translations[settings.value('current_language')]['dec_font_message']}
Ctrl+Shift+P{translations[settings.value('current_language')]['image_message']}
Ctrl+Shift+W+S{translations[settings.value('current_language')]['save_workspace_message']}
Ctrl+F{translations[settings.value('current_language')]['find_message']}
Ctrl+H{translations[settings.value('current_language')]['replace_message']}
{translations[settings.value( + 'current_language')]['help_shortcut']}{translations[settings.value( + 'current_language')]['help_description']}
Ctrl+N{ + translations[settings.value('current_language')]['new_message']}
Ctrl+O{translations[settings.value( + 'current_language')]['open_message']}
Ctrl+S{translations[settings.value( + 'current_language')]['save_message']}
Ctrl+Shift+S{translations[settings.value( + 'current_language')]['save_as_message']}
Ctrl+P{translations[settings.value( + 'current_language')]['print_message']}
Ctrl+Z{translations[settings.value( + 'current_language')]['undo_message']}
Ctrl+Y{translations[settings.value( + 'current_language')]['redo_message']}
Ctrl+Shift+V{translations[settings.value( + 'current_language')]['viewmode_message']}
Ctrl+Shift+T{translations[settings.value( + 'current_language')]['darklight_message']}
Ctrl+Shift+D{ + translations[settings.value('current_language')]['help_message']}
Ctrl+Shift+C{translations[settings.value( + 'current_language')]['font_color_message']}
Ctrl+Shift+B{translations[settings.value( + 'current_language')]['background_color_message']}
Ctrl+Shift+F{ + translations[settings.value('current_language')]['font_message']}
Ctrl++{translations[settings.value( + 'current_language')]['inc_font_message']}
Ctrl+-{translations[settings.value( + 'current_language')]['dec_font_message']}
Ctrl+Shift+P{translations[settings.value( + 'current_language')]['image_message']}
Ctrl+Shift+W+S{translations[settings.value( + 'current_language')]['save_workspace_message']}
Ctrl+F{translations[settings.value( + 'current_language')]['find_message']}
Ctrl+H{translations[settings.value( + 'current_language')]['replace_message']}
") self.dock_widget.setWidget(self.help_label) @@ -1066,7 +1097,8 @@ def open(self): options = QFileDialog.Options() settings = QSettings("berkaygediz", "RichSpan") options |= QFileDialog.ReadOnly - file_filter = f"{translations[settings.value('current_language')]['rsdoc']} (*.rsdoc);;HTML (*.html);;Text (*.txt);;Key-Value (*.ini);;LOG (*.log);;JavaScript Object Notation (*.json);;Extensible Markup Language (*.xml);;Javascript (*.js);;Cascading Style Sheets (*.css);;Structured Query Language (*.sql);;Markdown (*.md)" + file_filter = f"{translations[settings.value( + 'current_language')]['rsdoc']} (*.rsdoc);;HTML (*.html);;Text (*.txt);;Key-Value (*.ini);;LOG (*.log);;JavaScript Object Notation (*.json);;Extensible Markup Language (*.xml);;Javascript (*.js);;Cascading Style Sheets (*.css);;Structured Query Language (*.sql);;Markdown (*.md)" selected_file, _ = QFileDialog.getOpenFileName( self, translations[settings.value("current_language")]["open"] + " — RichSpan ", self.directory, file_filter, options=options) if selected_file: @@ -1099,7 +1131,8 @@ def saveAs(self): options = QFileDialog.Options() settings = QSettings("berkaygediz", "RichSpan") options |= QFileDialog.ReadOnly - file_filter = f"{translations[settings.value('current_language')]['rsdoc']} (*.rsdoc);;HTML (*.html);;Text (*.txt);;Key-Value (*.ini);;LOG (*.log);;JavaScript Object Notation (*.json);;Extensible Markup Language (*.xml);;Javascript (*.js);;Cascading Style Sheets (*.css);;Structured Query Language (*.sql);;Markdown (*.md)" + file_filter = f"{translations[settings.value( + 'current_language')]['rsdoc']} (*.rsdoc);;HTML (*.html);;Text (*.txt);;Key-Value (*.ini);;LOG (*.log);;JavaScript Object Notation (*.json);;Extensible Markup Language (*.xml);;Javascript (*.js);;Cascading Style Sheets (*.css);;Structured Query Language (*.sql);;Markdown (*.md)" selected_file, _ = QFileDialog.getSaveFileName( self, translations[settings.value("current_language")]["save_as"] + " — RichSpan ", self.directory, file_filter, options=options) if selected_file: