mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-17 16:57:56 -07:00
GNOME dependable installation, structure and style improvements
Split utils in utils.py to a directory Moved ./gnome-shell_css/ to ./gnome-shell/.css/
This commit is contained in:
19
scripts/utils/replace_keywords.py
Normal file
19
scripts/utils/replace_keywords.py
Normal file
@@ -0,0 +1,19 @@
|
||||
def replace_keywords(file, *args):
|
||||
"""
|
||||
Replace file with several keywords
|
||||
:param file: file name where keywords must be replaced
|
||||
:param args: (keyword, replacement), (...), ...
|
||||
"""
|
||||
|
||||
# skip binary files in project
|
||||
if not file.lower().endswith(('.css', '.scss', '.svg')):
|
||||
return
|
||||
|
||||
with open(file, "r") as read_file:
|
||||
content = read_file.read()
|
||||
|
||||
for keyword, replacement in args:
|
||||
content = content.replace(keyword, replacement)
|
||||
|
||||
with open(file, "w") as write_file:
|
||||
write_file.write(content)
|
Reference in New Issue
Block a user