Commit dc52d012 authored by Olivier Samyn's avatar Olivier Samyn

Modified the python boards naming scheme from

  name=python file
  type=pythonboard
To:
  name=what you want
  type=pythonboard:pythonfile
parent b93edfe8
2004-03-03 set REAL_NAME environment variable <set EMAIL_ADDRESS environment variable>
* boards/melody.xml.in: Modified type for the new naming scheme
* boards/pythontest.xml.in: Modified type for the new naming scheme
* boards/redraw.xml.in: Modified type for the new naming scheme
* boards/watercycle.xml.in: Modified type for the new naming scheme
* src/boards/python.c: (pythonboard_start),
(pythonboard_is_our_board): Modify the python boards naming scheme to pythonboard:boardfile in place of type=pythonboard, name=filename.
2004-02-28 Bruno coudoin <bruno.coudoin@free.fr>
* boards/chronos.xml.in: added transportation levels
......
......@@ -2,7 +2,7 @@
<GCompris>
<Board
name="melody"
type="pythonboard"
type="pythonboard:melody"
section="/experience/."
difficulty="2"
icon="boardicons/melody.png"
......@@ -14,7 +14,7 @@
<_prerequisite>Move and click the mouse</_prerequisite>
<_goal>Ear training activity</_goal>
<_manual>Listen the sound sequence played.
Then try to repeat it clicking on
Then try to repeat it clicking on
the elements.
You can listen again clicking on the repeat button.</_manual>
</Board>
......
......@@ -2,7 +2,7 @@
<GCompris>
<Board
name="pythontest"
type="pythonboard"
type="pythonboard:pythontest"
section="/."
icon="boardicons/python.png"
difficulty="0"
......
......@@ -2,7 +2,7 @@
<GCompris>
<Board
name="redraw"
type="pythonboard"
type="pythonboard:redraw"
section="/fun/."
mode="normal"
difficulty="3"
......
......@@ -2,7 +2,7 @@
<GCompris>
<Board
name="watercycle"
type="pythonboard"
type="pythonboard:watercycle"
section="/experience/."
difficulty="3"
icon="boardicons/watercycle.png"
......@@ -13,8 +13,8 @@
Tux comes from a long fishing party on his boat. Help him to have a shower.</_description>
<_prerequisite></_prerequisite>
<_goal>Learn the water cycle</_goal>
<_manual>Click on different active elements : sun, cloud, water pump station,
water cleanup station in order to reactivate the whole
<_manual>Click on different active elements : sun, cloud, water pump station,
water cleanup station in order to reactivate the whole
water system.
When done and Tux is in his shower, push the shower button for him.</_manual>
</Board>
......
/* gcompris - python.c
*
* Copyright (C) 2003 GCompris Developpement Team
......@@ -175,6 +176,7 @@ pythonboard_start (GcomprisBoard *agcomprisBoard){
static char* python_prog_name="gcompris";
char* boarddir;
char* boardclass;
char* board_file_name;
gchar *userplugindir;
if(agcomprisBoard!=NULL){
......@@ -214,10 +216,11 @@ pythonboard_start (GcomprisBoard *agcomprisBoard){
python_gcompris_module_init();
/* Python is now initialized we create some usefull variables */
boardclass = g_strdup_printf("Gcompris_%s", agcomprisBoard->name);
board_file_name = strchr(agcomprisBoard->type, ':')+1;
boardclass = g_strdup_printf("Gcompris_%s", board_file_name);
/* Insert the board module into the python's interpreter */
python_board_module = PyImport_ImportModuleEx(agcomprisBoard->name,
python_board_module = PyImport_ImportModuleEx(board_file_name,
globals,
globals,
NULL);
......@@ -295,19 +298,17 @@ void pythonboard_end (void){
* Return TRUE if the board is a python one.
*/
gboolean pythonboard_is_our_board (GcomprisBoard *agcomprisBoard){
if(pythonboard_is_ready){
if (agcomprisBoard!=NULL)
{
if(g_strcasecmp(agcomprisBoard->type, "pythonboard")==0)
{
/* Set the plugin entry */
agcomprisBoard->plugin=&pythonboard_bp;
g_print("pythonboard: is our board = TRUE\n");
return TRUE;
}
if(pythonboard_is_ready) {
if (agcomprisBoard!=NULL) {
if (g_ascii_strncasecmp(agcomprisBoard->type, "pythonboard:", 12)==0) {
/* Set the plugin entry */
agcomprisBoard->plugin=&pythonboard_bp;
//g_print("pythonboard: is our board = TRUE\n");
return TRUE;
}
}
}
return FALSE;
}
......
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