Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# Compile SCSS
variables_scss_filepath = os.path.join(theme_qss_path, VARIABLES_SCSS_FILE)
theme_main_scss_filepath = os.path.join(theme_qss_path, MAIN_SCSS_FILE)
theme_qss_filepath = os.path.join(theme_root_path, QSS_FILE)
stylesheet = create_qss(
qss_filepath=theme_qss_filepath,
main_scss_filepath=theme_main_scss_filepath,
variables_scss_filepath=variables_scss_filepath,
palette=custom_palette,
)
# Update colors in text
with open(theme_main_scss_filepath, 'r') as fh:
data = fh.read()
for key, color in DarkPalette.color_palette().items():
custom_color = custom_palette.color_palette()[key].upper()
data = data.replace(color, custom_color)
stylesheet = stylesheet.replace(color, custom_color)
with open(theme_main_scss_filepath, 'w') as fh:
fh.write(data)
with open(theme_qss_filepath, 'w') as fh:
fh.write(stylesheet)
return stylesheet