Commit 3441866e authored by thiolliere's avatar thiolliere
Browse files

add edupi

parent 174c51e3
import json
# machine must provide write_file and exec_cmd functions
def run(machine, name, timezone, wifi_pwd, kalite, aflatoun, zim_install):
def run(machine, name, timezone, wifi_pwd, edupi, aflatoun, kalite, zim_install):
machine.exec_cmd("sudo apt-get update")
machine.exec_cmd("sudo apt-get install -y python-pip git python-dev libffi-dev libssl-dev gnutls-bin")
......@@ -31,6 +31,9 @@ def run(machine, name, timezone, wifi_pwd, kalite, aflatoun, zim_install):
"aflatoun": {
"activated": aflatoun,
},
"edupi": {
"activated": edupi,
},
"idc_import": {
"activated": "False",
"content_name": [],
......
......@@ -31,6 +31,10 @@ KALITE_SIZES = {
# TODO: 8G may not be enough
AFLATOUN_SIZE = 8589934592;
# TODO: 100 MB may be enough
# TODO: use 200 MB for now
EDUPI_SIZE = 2097152;
def hide_on_delete(widget, event):
widget.hide()
return True
......@@ -236,6 +240,9 @@ class Application:
# aflatoun
self.component.aflatoun_switch.connect("notify::active", lambda switch, state: self.update_free_space())
# edupi
self.component.edupi_switch.connect("notify::active", lambda switch, state: self.update_free_space())
# language tree view
renderer_text = Gtk.CellRendererText()
column_text = Gtk.TreeViewColumn("Language", renderer_text, text=0)
......@@ -372,6 +379,8 @@ class Application:
aflatoun = self.component.aflatoun_switch.get_active()
edupi = self.component.edupi_switch.get_active()
build_dir = self.component.build_path_chooser.get_filename()
condition = build_dir != None
validate_label(self.component.build_path_chooser_label, condition)
......@@ -398,6 +407,7 @@ class Application:
wifi_pwd=wifi_pwd,
kalite=kalite,
aflatoun=aflatoun,
edupi=edupi,
zim_install=zim_install,
size=output_size,
logger=self.logger,
......@@ -446,6 +456,8 @@ class Application:
used_space += KALITE_SIZES[lang]
if self.component.aflatoun_switch.get_active():
used_space += AFLATOUN_SIZE
if self.component.edupi_switch.get_active():
used_space += EDUPI_SIZE
return self.get_output_size() - used_space
......
......@@ -11,7 +11,7 @@ import data
import sys
import re
def run_installation(name, timezone, wifi_pwd, kalite, aflatoun, zim_install, size, logger, cancel_event, sd_card, done_callback=None, build_dir="."):
def run_installation(name, timezone, wifi_pwd, kalite, aflatoun, edupi, zim_install, size, logger, cancel_event, sd_card, done_callback=None, build_dir="."):
try:
# Prepare SD Card
......@@ -75,6 +75,7 @@ def run_installation(name, timezone, wifi_pwd, kalite, aflatoun, zim_install, si
timezone=timezone,
wifi_pwd=wifi_pwd,
kalite=kalite,
edupi=edupi,
aflatoun=aflatoun,
zim_install=zim_install)
......@@ -101,6 +102,15 @@ def run_installation(name, timezone, wifi_pwd, kalite, aflatoun, zim_install, si
'fa': 'book',
'is_staff': False
})
if edupi == True:
custom_cards.append({
'category': 'manage',
'url': 'http://edupi.koombook.lan',
'title': 'Edupi',
'description': 'content management application',
'fa': 'folder',
'is_staff': False
})
kb_conf = """from .pibox import * # pragma: no flakes
......
......@@ -799,7 +799,7 @@ and digits '0' to '9'</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">10</property>
<property name="position">9</property>
</packing>
</child>
<child>
......@@ -837,6 +837,41 @@ and digits '0' to '9'</property>
<property name="position">11</property>
</packing>
</child>
<child>
<object class="GtkBox" id="no_id_29">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkLabel" id="no_id_64">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Edupi :</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkSwitch" id="edupi_switch">
<property name="visible">True</property>
<property name="can_focus">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">12</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment