Skip to content

Commit ea027ed

Browse files
committed
no longer init_activities
1 parent a1ec6ac commit ea027ed

File tree

2 files changed

+1
-87
lines changed

2 files changed

+1
-87
lines changed

activity.py

+1-83
Original file line numberDiff line numberDiff line change
@@ -42,86 +42,4 @@ def delete(self, activity):
4242

4343
def list(self):
4444
return self.activities.all()
45-
46-
def init_default(self):
47-
activities_collection = self.activities.search(self.query.stock == True)
48-
if len(activities_collection) == 0:
49-
f = open("activity_default.json", "r")
50-
activity = json.load(f)
51-
"""
52-
activity = {
53-
"name": "default",
54-
"default": True,
55-
"stock": True,
56-
"codeFont": 'ubuntumono',
57-
"description": None,
58-
"drawerEnabled": True,
59-
"exec": {
60-
"camera": True,
61-
"log": True,
62-
},
63-
"fontSize": 'Medio',
64-
"showName": True,
65-
"maxBlocks": None,
66-
"capsSwitch": True,
67-
"bodyFont": "Roboto",
68-
"availableViews": [],
69-
"viewSource": None,
70-
"autoRecVideo": None,
71-
"toolbox": {
72-
"kind": "flyoutToolbox",
73-
"contents": []
74-
},
75-
"buttons": [
76-
{
77-
"action": "clearProgramDlg",
78-
"icon": "clear",
79-
"label": "message.activity_program_clear",
80-
"type": "text",
81-
},
82-
{
83-
"action": 'saveProgram',
84-
"icon": 'save',
85-
"label": 'message.activity_program_save',
86-
"type": 'text',
87-
},
88-
{
89-
"action": 'toggleSaveAs',
90-
"icon": 'edit',
91-
"label": 'message.activity_program_save_as',
92-
"type": 'text',
93-
},
94-
{
95-
"action": 'loadProgramList',
96-
"icon": 'folder_open',
97-
"label": 'message.activity_program_load',
98-
"type": 'text',
99-
},
100-
{
101-
"action": 'runProgram',
102-
"icon": 'play_arrow',
103-
"label": 'message.activity_program_run',
104-
"type": 'text',
105-
},
106-
{
107-
"action": 'getProgramCode',
108-
"icon": 'code',
109-
"label": 'message.activity_program_show_code',
110-
"type": 'text',
111-
},
112-
{
113-
"action": 'exportProgram',
114-
"icon": 'fa-file-export',
115-
"label": 'message.activity_program_export',
116-
"type": 'text',
117-
},
118-
{
119-
"action": 'pickFile',
120-
"icon": 'fa-file-import',
121-
"label": 'message.activity_program_import',
122-
"type": 'text',
123-
}],
124-
}
125-
"""
126-
self.save(activity)
127-
45+

main.py

-4
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,6 @@ def run_server():
486486
CNNManager.get_instance()
487487
EventManager.get_instance("coderbot")
488488

489-
# Programs and Activities databases
490-
activities = Activities.get_instance()
491-
activities.init_default()
492-
493489
if app.bot_config.get('load_at_start') and app.bot_config.get('load_at_start'):
494490
prog = app.prog_engine.load(app.bot_config.get('load_at_start'))
495491
prog.execute()

0 commit comments

Comments
 (0)