diff --git a/apps/code/catalog.de.i18n b/apps/code/catalog.de.i18n index bbfd013aa..b0e507e92 100644 --- a/apps/code/catalog.de.i18n +++ b/apps/code/catalog.de.i18n @@ -69,6 +69,11 @@ PythonImportKandinsky = "kandinsky Modul importieren" PythonImportRandom = "random Modul importieren" PythonImportMath = "math Modul importieren" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" +PythonImportOs = "os Modul importieren" +PythonOsUname = "Informieren Sie sich über das System" +PythonOsRemove = "Datei namens Dateiname entfernen" +PythonOsRename = "Datei mit altem Namen in neuen Namen umbenennen" +PythonOsListdir = "Dateien im Speicher auflisten" PythonImportTime = "time Modul importieren" PythonImportTurtle = "turtle Modul importieren" PythonIndex = "Index, bei dem x zuerst vorkommt" diff --git a/apps/code/catalog.en.i18n b/apps/code/catalog.en.i18n index 5f8657118..d546a6392 100644 --- a/apps/code/catalog.en.i18n +++ b/apps/code/catalog.en.i18n @@ -196,6 +196,11 @@ PythonTurtleSpeed = "Drawing speed between 0 and 10" PythonTurtleWrite = "Display a text" PythonUniform = "Floating point number in [a,b]" PythonImportTime = "Import time module" +PythonImportOs = "Import os module" +PythonOsUname = "Get infos about the system" +PythonOsRemove = "Remove file named filename" +PythonOsRename = "Rename file oldname to newname" +PythonOsListdir = "List files in memory" PythonTimePrefix = "time module function prefix" PythonTimeSleep = "Wait for n second" PythonMonotonic = "Return monotonic time" diff --git a/apps/code/catalog.es.i18n b/apps/code/catalog.es.i18n index 35fa14d4e..6a30ad360 100644 --- a/apps/code/catalog.es.i18n +++ b/apps/code/catalog.es.i18n @@ -196,6 +196,11 @@ PythonTurtleSpeed = "Drawing speed between 0 and 10" PythonTurtleWrite = "Display a text" PythonUniform = "Floating point number in [a,b]" PythonImportTime = "Import time module" +PythonImportOs = "Import os module" +PythonOsUname = " Información del sistema " +PythonOsRemove = "Eliminar un archivo" +PythonOsRename = "Renombrar archivo" +PythonOsListdir = "Archivos de la lista" PythonTimePrefix = "time module function prefix" PythonTimeSleep = "Esperar n segundos" PythonMonotonic = "Tiempo monótono de retorno" diff --git a/apps/code/catalog.fr.i18n b/apps/code/catalog.fr.i18n index 9b436400c..8561a0c05 100644 --- a/apps/code/catalog.fr.i18n +++ b/apps/code/catalog.fr.i18n @@ -196,6 +196,11 @@ PythonTurtleSpeed = "Vitesse du tracé entre 0 et 10" PythonTurtleWrite = "Affiche un texte" PythonUniform = "Nombre décimal dans [a,b]" PythonImportTime = "Importation du module temps" +PythonImportOs = "Importation du module os" +PythonOsUname = "Donne des infos sur le système" +PythonOsRemove = "Supprime le fichier nommé filename" +PythonOsRename = "Renomme oldname en newname" +PythonOsListdir = "Liste les fichiers" PythonTimePrefix = "Préfixe fonction du module temps" PythonTimeSleep = "Attendre n secondes" PythonMonotonic = "Retourne le temps monotonic" diff --git a/apps/code/catalog.hu.i18n b/apps/code/catalog.hu.i18n index c344ab2bf..74b3f66d8 100644 --- a/apps/code/catalog.hu.i18n +++ b/apps/code/catalog.hu.i18n @@ -70,6 +70,11 @@ PythonImportRandom = "Véletlenszerü modul importálása" PythonImportMath = "Import matematikai modul" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" PythonImportTime = "Idömodul importálása" +PythonImportOs = "Os modul importálása" +PythonOsUname = "Információ a rendszerről" +PythonOsRemove = "Fájl eltávolítása" +PythonOsRename = "Fájl átnevezése" +PythonOsListdir = "Fájlok listázása" PythonImportTurtle = "Import teknös modul" PythonIndex = "Az elsö x esemény indexe" PythonInput = "Érték kérése" diff --git a/apps/code/catalog.it.i18n b/apps/code/catalog.it.i18n index eaecb080c..a1c54071a 100644 --- a/apps/code/catalog.it.i18n +++ b/apps/code/catalog.it.i18n @@ -71,6 +71,11 @@ PythonImportMath = "Importa modulo math" PythonImportMatplotlibPyplot = "Importa modulo matplotlib.pyplot" PythonImportTurtle = "Importa del modulo turtle" PythonImportTime = "Importa del modulo time" +PythonImportOs = "Importa modulo os" +PythonOsUname = "Ottieni informazioni sul sistema" +PythonOsRemove = "Rimuovere un file" +PythonOsRename = "Rinomina file" +PythonOsListdir = "Elenca file" PythonIndex = "Indice prima occorrenza di x" PythonInput = "Inserire un valore" PythonInsert = "Inserire x in posizione i-esima" diff --git a/apps/code/catalog.nl.i18n b/apps/code/catalog.nl.i18n index bbe2b04c5..bc0361ed8 100644 --- a/apps/code/catalog.nl.i18n +++ b/apps/code/catalog.nl.i18n @@ -70,6 +70,11 @@ PythonImportRandom = "Importeer random module" PythonImportMath = "Importeer math module" PythonImportMatplotlibPyplot = "Import matplotlib.pyplot module" PythonImportTime = "Importeer time module" +PythonImportOs = "Importeer os module" +PythonOsUname = " Krijg systeeminfo" +PythonOsRemove = "Een bestand verwijderen" +PythonOsRename = "Hernoem bestand" +PythonOsListdir = "Lijstbestanden" PythonImportTurtle = "Importeer turtle module" PythonIndex = "Index van de eerste x aanwezigheden" PythonInput = "Wijs een waarde toe" diff --git a/apps/code/catalog.pt.i18n b/apps/code/catalog.pt.i18n index f0b401b81..b0decb0ab 100644 --- a/apps/code/catalog.pt.i18n +++ b/apps/code/catalog.pt.i18n @@ -196,6 +196,11 @@ PythonTurtleSpeed = "Velocidade do desenho entre 0 e 10" PythonTurtleWrite = "Mostrar um texto" PythonUniform = "Número decimal em [a,b]" PythonImportTime = "Import time module" +PythonImportOs = "Import os module" +PythonOsUname = " Obter informações do sistema" +PythonOsRemove = "Remover um ficheiro" +PythonOsRename = "Renomear ficheiro" +PythonOsListdir = "Listar ficheiros" PythonTimePrefix = "time module function prefix" PythonTimeSleep = "Wait for n second" PythonMonotonic = "Return monotonic time" diff --git a/apps/code/catalog.universal.i18n b/apps/code/catalog.universal.i18n index 371a33f44..768a4d7d2 100644 --- a/apps/code/catalog.universal.i18n +++ b/apps/code/catalog.universal.i18n @@ -86,6 +86,8 @@ PythonCommandImportKandinsky = "import kandinsky" PythonCommandImportMath = "import math" PythonCommandImportMatplotlibPyplot = "import matplotlib.pyplot" PythonCommandImportRandom = "import random" +PythonCommandImportOs = "import os" +PythonCommandImportFromOs = "from os import *" PythonCommandImportTime = "import time" PythonCommandImportTurtle = "import turtle" PythonCommandIndex = "list.index(x)" @@ -212,6 +214,12 @@ PythonCommandTurtleFunctionWithoutArg = "turtle.\x11" PythonCommandUniform = "uniform(a,b)" PythonConstantE = "2.718281828459045" PythonConstantPi = "3.141592653589793" +PythonOsCommandUname = "uname()" +PythonOsCommandRemove = "remove(filename)" +PythonOsCommandRename = "rename(oldname, newname)" +PythonOsCommandRemoveWithoutArg = "remove(\x11)" +PythonOsCommandRenameWithoutArg = "rename(\x11,)" +PythonOsCommandListdir = "listdir()" PythonTurtleCommandBackward = "backward(x)" PythonTurtleCommandCircle = "circle(r)" PythonTurtleCommandColor = "color('c')" diff --git a/apps/code/python_toolbox.cpp b/apps/code/python_toolbox.cpp index bcd5ec925..fa8f72f24 100644 --- a/apps/code/python_toolbox.cpp +++ b/apps/code/python_toolbox.cpp @@ -256,6 +256,15 @@ const ToolboxMessageTree TimeModuleChildren[] = { ToolboxMessageTree::Leaf(I18n::Message::PythonCommandSleep, I18n::Message::PythonSleep) }; +const ToolboxMessageTree OsModuleChildren[] = { + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportOs, I18n::Message::PythonImportOs, false), + ToolboxMessageTree::Leaf(I18n::Message::PythonCommandImportFromOs, I18n::Message::PythonImportOs, false), + ToolboxMessageTree::Leaf(I18n::Message::PythonOsCommandUname, I18n::Message::PythonOsUname, false), + ToolboxMessageTree::Leaf(I18n::Message::PythonOsCommandRemove, I18n::Message::PythonOsRemove, false, I18n::Message::PythonOsCommandRemoveWithoutArg), + ToolboxMessageTree::Leaf(I18n::Message::PythonOsCommandRename, I18n::Message::PythonOsRename, false, I18n::Message::PythonOsCommandRenameWithoutArg), + ToolboxMessageTree::Leaf(I18n::Message::PythonOsCommandListdir, I18n::Message::PythonOsListdir, false) +}; + const ToolboxMessageTree modulesChildren[] = { ToolboxMessageTree::Node(I18n::Message::MathModule, MathModuleChildren), ToolboxMessageTree::Node(I18n::Message::CmathModule, CMathModuleChildren), @@ -264,6 +273,7 @@ const ToolboxMessageTree modulesChildren[] = { ToolboxMessageTree::Node(I18n::Message::RandomModule, RandomModuleChildren), ToolboxMessageTree::Node(I18n::Message::KandinskyModule, KandinskyModuleChildren), ToolboxMessageTree::Node(I18n::Message::IonModule, IonModuleChildren), + ToolboxMessageTree::Node(I18n::Message::OsModule, OsModuleChildren), ToolboxMessageTree::Node(I18n::Message::TimeModule, TimeModuleChildren) }; diff --git a/apps/code/toolbox.universal.i18n b/apps/code/toolbox.universal.i18n index 0600a4dfd..72bd47ef9 100644 --- a/apps/code/toolbox.universal.i18n +++ b/apps/code/toolbox.universal.i18n @@ -3,6 +3,7 @@ IonModule = "ion" KandinskyModule = "kandinsky" MathModule = "math" MatplotlibPyplotModule = "matplotlib.pyplot" +OsModule = "os" TimeModule = "time" TurtleModule = "turtle" ForLoopMenu = "For" diff --git a/ion/src/simulator/shared/main_sdl.cpp b/ion/src/simulator/shared/main_sdl.cpp index 488e7e680..400cda9b0 100644 --- a/ion/src/simulator/shared/main_sdl.cpp +++ b/ion/src/simulator/shared/main_sdl.cpp @@ -78,18 +78,22 @@ int main(int argc, char * argv[]) { arguments.push_back(language); } +#ifndef __EMSCRIPTEN__ if (!argument_volatile) { loadPython(&arguments); SDL_SetEventFilter(event_filter, NULL); } +#endif Ion::Simulator::Main::init(); ion_main(arguments.size(), &arguments[0]); +#ifndef __EMSCRIPTEN__ if (!argument_volatile) { savePython(); } +#endif Ion::Simulator::Main::quit();