mirror of
https://github.com/imarkoff/Marble-shell-theme.git
synced 2025-09-18 01:07:55 -07:00
Refactored Theme class to correspond SOLID patterns
This commit is contained in:
19
scripts/utils/style_manager.py
Normal file
19
scripts/utils/style_manager.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from scripts.utils import generate_file
|
||||
|
||||
|
||||
class StyleManager:
|
||||
def __init__(self, output_file: str):
|
||||
self.output_file = output_file
|
||||
|
||||
def append_content(self, content: str):
|
||||
with open(self.output_file, 'a') as output:
|
||||
output.write(content + '\n')
|
||||
|
||||
def prepend_content(self, content: str):
|
||||
with open(self.output_file, 'r') as output:
|
||||
main_content = output.read()
|
||||
with open(self.output_file, 'w') as output:
|
||||
output.write(content + '\n' + main_content)
|
||||
|
||||
def generate_combined_styles(self, sources_location: str, temp_folder: str):
|
||||
generate_file(sources_location, temp_folder, self.output_file)
|
Reference in New Issue
Block a user