diff options
author | Daniel Francis <francis@sugarlabs.org> | 2012-12-27 18:47:14 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2012-12-27 18:47:14 (GMT) |
commit | b30aea00dc27ba04c2d384b7c7855d9b672b28b0 (patch) | |
tree | 3045b75f7c3ff608929764f78a09393dd350af74 | |
parent | 586a5ff3004386b6226940182061e825e31174d5 (diff) |
Crear servidor web en la misma máquina
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | activity.py | 11 | ||||
m--------- | hnd_webapp | 0 | ||||
-rwxr-xr-x | runserver.sh | 6 | ||||
-rwxr-xr-x | setup.sh | 24 |
5 files changed, 42 insertions, 2 deletions
diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..921d236 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hnd_webapp"] + path = hnd_webapp + url = git://git.sugarlabs.org/research_hnd/hnd_test.git diff --git a/activity.py b/activity.py index 1d4f36c..08fd667 100644 --- a/activity.py +++ b/activity.py @@ -17,6 +17,9 @@ import logging logger = logging.getLogger('hnd') +import os +import subprocess + from gi.repository import Gtk from gi.repository import WebKit from sugar3.activity import activity @@ -25,8 +28,12 @@ from sugar3.activity.widgets import ActivityToolbarButton from sugar3.graphics.toolbarbox import ToolbarBox from sugar3.graphics.combobox import ComboBox -ACTIVITIES_URL = 'http://www.honduras-tests.com.ar/lesson.html?name=' +RUNSERVER = os.path.join(os.environ['SUGAR_BUNDLE_PATH'], 'runserver.sh') +SERVERDIR = os.path.join(os.environ['SUGAR_BUNDLE_PATH'], 'hnd_webapp') +subprocess.Popen([RUNSERVER, SERVERDIR]) + +ACTIVITIES_URL = 'http://0.0.0.0:8000/lesson.html?name=' grades = [('Tercer grado', [('unidad2', 'Perpendicularidad'), @@ -124,7 +131,7 @@ class HNDViewer(activity.Activity): # iconview = Gtk.IconView() # self._notebook.append_page(iconview) - self._browser.open('http://www.honduras-tests.com.ar/') +# self._browser.open('http://www.google.com.uy/') self.show_all() diff --git a/hnd_webapp b/hnd_webapp new file mode 160000 +Subproject 0a450dcf74f7f1134e8104fc4d1adfb67621f6b diff --git a/runserver.sh b/runserver.sh new file mode 100755 index 0000000..64d4c6e --- /dev/null +++ b/runserver.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +cd $1 + +# Make is not installed by default in OLPC builds. +python -m SimpleHTTPServer diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..2361e28 --- /dev/null +++ b/setup.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Copyright (C) 2012, One Laptop Per Child Association. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +# This script complements the standard setup.py + +git submodule init +git submodule update + +python setup.py $@ |