Skip to content

Commit 59f8ca9

Browse files
author
Arjan Egges
committed
Added MVC id extension
1 parent 58b95c8 commit 59f8ca9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

7 - mvc/mvc-after-strategy.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import tkinter as tk
22
import uuid
3+
import string
4+
import random
35
from abc import ABC, abstractmethod
46

57
# functional strategy
@@ -9,6 +11,9 @@ def generate_uuid1():
911
def generate_uuid4():
1012
return uuid.uuid4()
1113

14+
def generate_simple_id():
15+
return ''.join(random.choices(string.ascii_lowercase, k=30))
16+
1217
class Model:
1318
def __init__(self):
1419
self.uuid = []
@@ -81,5 +86,5 @@ def start_main_loop(self):
8186
self.root.mainloop()
8287

8388
# create the MVC & start the application
84-
c = Controller(Model(), TkView(), generate_uuid4)
89+
c = Controller(Model(), TkView(), generate_simple_id)
8590
c.start()

0 commit comments

Comments
 (0)