Skip to content

Commit 7105103

Browse files
authored
Merge pull request #210 from TrevisanGMW/dev
release <- dev (3.4.1)
2 parents 856330f + 6f14f68 commit 7105103

File tree

5 files changed

+85
-61
lines changed

5 files changed

+85
-61
lines changed

gt/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22

33
# Package Variables
4-
__version_tuple__ = (3, 4, 0)
4+
__version_tuple__ = (3, 4, 1)
55
__version_suffix__ = ""
66
__version__ = ".".join(str(n) for n in __version_tuple__) + __version_suffix__
77
__authors__ = ["Guilherme Trevisan"]

gt/core/str.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,18 @@ def replace_keys_with_values(input_string, replacements_dict, case_sensitive=Tru
531531
# Create a case-insensitive version of the replacements dictionary
532532
replacements_dict = {key.lower(): value for key, value in replacements_dict.items()}
533533
lower_input_string = input_string.lower()
534+
output_string = input_string
535+
534536
for key, value in replacements_dict.items():
535-
if key in lower_input_string:
536-
# This replacement needs to handle multiple occurrences
537-
start = 0
538-
while (start := lower_input_string.find(key, start)) != -1:
537+
start = 0
538+
while start != -1:
539+
start = lower_input_string.find(key, start)
540+
if start != -1:
539541
end = start + len(key)
540-
input_string = input_string[:start] + value + input_string[end:]
542+
output_string = output_string[:start] + value + output_string[end:]
541543
lower_input_string = lower_input_string[:start] + value.lower() + lower_input_string[end:]
542-
start = end
544+
start += len(value)
545+
return output_string
543546
else:
544547
for key, value in replacements_dict.items():
545548
input_string = input_string.replace(key, value)

gt/tools/package_updater/package_updater_model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,11 @@ def print_extract_progress(current_file, total_files):
435435
sys.path.insert(0, extracted_module_path)
436436

437437
# Import and run installer -----------------------------------------------
438-
import gt.core.setup as setup_utils
438+
import gt.core.setup as core_setup
439439

440440
is_installed = False
441441
try:
442-
is_installed = setup_utils.install_package(
442+
is_installed = core_setup.install_package(
443443
callbacks=[self.progress_win.add_text_to_output_box, self.progress_win.increase_progress_bar_value]
444444
)
445445
except Exception as e:

gt/ui/progress_bar.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,6 @@ def close_parent_window(self):
280280
window.first_button.clicked.connect(window.close_window)
281281

282282
window.set_progress_bar_max_value(8)
283-
# window.set_progress_bar_done()
284-
# import core.setup_utils as setup_utils
285-
# setup_utils.install_package(passthrough_functions=[window.append_text_to_output_box,
286-
# window.increase_progress_bar_value])
287283

288284
index = 0
289285
import time

0 commit comments

Comments
 (0)