Rename patterns module to presets
Rename the driver module and update imports so tests and main entry use the new presets naming, while moving Preset to its own file. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
24
src/preset.py
Normal file
24
src/preset.py
Normal file
@@ -0,0 +1,24 @@
|
||||
class Preset:
|
||||
def __init__(self, data):
|
||||
# Set default values for all preset attributes
|
||||
self.p = "off"
|
||||
self.d = 100
|
||||
self.b = 127
|
||||
self.c = [(255, 255, 255)]
|
||||
self.a = True
|
||||
self.n1 = 0
|
||||
self.n2 = 0
|
||||
self.n3 = 0
|
||||
self.n4 = 0
|
||||
self.n5 = 0
|
||||
self.n6 = 0
|
||||
|
||||
# Override defaults with provided data
|
||||
self.edit(data)
|
||||
|
||||
def edit(self, data=None):
|
||||
if not data:
|
||||
return False
|
||||
for key, value in data.items():
|
||||
setattr(self, key, value)
|
||||
return True
|
||||
Reference in New Issue
Block a user