Commit 775e711f authored by Louis's avatar Louis

Suppression de tout ce qui concerne QT

Le packaging est cassé
parent 775e2baa
Pipeline #60854 failed with stage
in 10 seconds
......@@ -4,6 +4,7 @@ Programming :
=============
Jérôme Ortais (jerome.ortais[at]pyromaths.org)
Arnaud Kientz (arnaud[at]pyromaths.org)
Louis Paternault (spalax+python[at]gresille.org)
Yves Gesnel
Guillaume Barthélémy
Nicolas Bissonnier
......
Version XX.XX
* Passage à Python3
* Séparation de pyromaths en deux projets : pyromaths (client en ligne de commande) et client QT.
Version 18.06
* Nouvel exercice niveau terminale ES (spécialité) : Déterminer l'état stable d'un graphe probabiliste (en utilisant un système d'équations).
......
Pyromaths est un programme qui a pour but de créer des exercices type de mathématiques niveau collège et lycée ainsi que leur corrigé. C'est ce qu'on appelle parfois un exerciseur. Contrairement à de nombreux autres projets, Pyromaths a pour objectif de proposer une correction véritablement détaillée des exercices proposés et pas seulement une solution.
Il permet par exemple de proposer des devoirs maison aux élèves et de leur distribuer ensuite la correction. Il peut aussi servir à des familles afin qu'un élève puisse travailler un point du programme et se corriger ensuite.
\ No newline at end of file
This diff is collapsed.
......@@ -2,14 +2,14 @@ Source: pyromaths
Maintainer: Jérôme Ortais <jerome.ortais@pyromaths.org>
Section: contrib/math
Priority: optional
Build-Depends: debhelper (>= 8), dh-python, python3-all, python3-setuptools, python3-jinja2, python3-sphinx, python3-sphinx-argparse, python3-lxml
Build-Depends: debhelper (>= 8), dh-python, python3-all, python3-setuptools, python3-jinja2, python3-sphinx, python3-sphinx-argparse
X-Python-Version: >= 3.2
Standards-Version: 4.1.4
Homepage: http://www.pyromaths.org/
Package: pyromaths
Architecture: all
Depends: ${python3:Depends}, ${misc:Depends}, python3-jinja2, python3-qt5, python3-lxml, texlive-pstricks, texlive-latex-base, texlive-latex-extra, texlive-fonts-recommended, texlive-latex-recommended, latexmk, asymptote, texlive-pictures, texlive-lang-french
Depends: ${python3:Depends}, ${misc:Depends}, python3-jinja2, texlive-pstricks, texlive-latex-base, texlive-latex-extra, texlive-fonts-recommended, texlive-latex-recommended, latexmk, asymptote, texlive-pictures, texlive-lang-french
Description: Exerciseur de mathématiques créant des fiches LaTeX
Pyromaths est un programme qui a pour but de créer des exercices
type de mathématiques niveau collège et lycée ainsi que leur corrigé. C'est
......
#!/usr/bin/env python3
# Pyromaths
# Un programme en Python qui permet de créer des fiches d'exercices types de
# mathématiques niveau collège ainsi que leur corrigé en LaTeX.
# Copyright (C) 2006 -- Jérôme Ortais (jerome.ortais@pyromaths.org)
#
# 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
#
__import__('pkg_resources').declare_namespace(__name__)
This diff is collapsed.
#!/usr/bin/env python3
# Pyromaths
# Un programme en Python qui permet de créer des fiches d'exercices types de
# mathématiques niveau collège ainsi que leur corrigé en LaTeX.
# Copyright (C) 2006 -- Jérôme Ortais (jerome.ortais@pyromaths.org)
#
# 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
import gettext
from sys import argv, exit
import sys
from os import access, R_OK, makedirs
from os.path import join, isdir, dirname, realpath, split
from codecs import open
def main():
#===============================================================================
# Imports spécifiques à Pyromaths
#===============================================================================
locale_dir = join(dirname(__file__), '../../locale/')
locale_dir = realpath(locale_dir)
gettext.install('pyromaths', localedir=locale_dir)
from .config import create_config_file, modify_config_file
from ..outils.TestEnv import test
from ..Values import CONFIGDIR
from . import Ui_MainWindow
from PyQt5 import QtGui, QtWidgets
class StartQT4(QtWidgets.QMainWindow, Ui_MainWindow):
def __init__(self, parent=None):
QtWidgets.QWidget.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
#===========================================================================
# Création du fichier de configuration si inexistant
#===========================================================================
if not access(join(CONFIGDIR, "pyromaths.xml"), R_OK):
if not isdir(CONFIGDIR): makedirs(CONFIGDIR)
f = open(join(CONFIGDIR, "pyromaths.xml"), encoding='utf-8', mode='w')
f.write(u"" + create_config_file())
f.close()
modify_config_file(join(CONFIGDIR, "pyromaths.xml"))
templatesdir = join(CONFIGDIR, "templates")
if not isdir(templatesdir): makedirs(templatesdir)
packagesdir = join(CONFIGDIR, "packages")
if not isdir(packagesdir): makedirs(packagesdir)
app = QtWidgets.QApplication(argv)
pyromaths = StartQT4()
# Intégration de QTranslator
from PyQt5.QtCore import QTranslator
translator = QTranslator()
translator.load("qtmac_fr", "data")
app.installTranslator(translator)
pyromaths.show()
test(pyromaths)
exit(app.exec_())
if __name__ == "__main__":
main()
#!/usr/bin/env python3
# Pyromaths
# Un programme en Python qui permet de créer des fiches d'exercices types de
# mathématiques niveau collège ainsi que leur corrigé en LaTeX.
# Copyright (C) 2006 -- Jérôme Ortais (jerome.ortais@pyromaths.org)
#
# 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
#
"""Gestion du fichier de configuration de Pyromaths"""
import codecs
import os
from lxml import etree
from lxml import _elementpath as DONTUSE # Astuce pour inclure lxml dans Py2exe
from pyromaths.Values import HOME, VERSION, CONFIGDIR
def create_config_file():
"""Crée le fichier de configuration au format xml"""
root = etree.Element("pyromaths")
child = etree.SubElement(root, "options")
etree.SubElement(child, "nom_fichier").text = _("exercices")
etree.SubElement(child, "chemin_fichier").text = "%s" % HOME
etree.SubElement(child, "titre_fiche").text = _(u"Fiche de révisions")
etree.SubElement(child, "corrige").text = "True"
etree.SubElement(child, "pdf").text = "True"
etree.SubElement(child, "unpdf").text = "False"
etree.SubElement(child, "modele").text = "pyromaths.tex"
child = etree.SubElement(root, "informations")
etree.SubElement(child, "version").text = VERSION
etree.SubElement(child, "description").text = _(u"Pyromaths est un programme qui permet de générer des fiches d’exercices de mathématiques de collège ainsi que leur corrigé. Il crée des fichiers au format pdf qui peuvent ensuite être imprimés ou lus sur écran.")
etree.SubElement(child, "icone").text = "pyromaths.ico"
subchild = etree.SubElement(child, "auteur")
etree.SubElement(subchild, "nom").text = u"Jérôme Ortais"
etree.SubElement(subchild, "email").text = u"jerome.ortais@pyromaths.org"
etree.SubElement(subchild, "site").text = "http://www.pyromaths.org"
return etree.tostring(root, pretty_print=True)
def indent(elem, level=0):
"""Indente correctement les fichiers xml.
By Filip Salomonsson; published on February 06, 2007.
http://infix.se/2007/02/06/gentlemen-indent-your-xml"""
i = "\n" + level * " "
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + " "
for e in elem:
indent(e, level + 1)
if not e.tail or not e.tail.strip():
e.tail = i + " "
if not e.tail or not e.tail.strip():
e.tail = i
else:
if level and (not elem.tail or not elem.tail.strip()):
elem.tail = i
return elem
def modify_config_file(fichier):
"""Modifie le fichier de configuration si besoin, excepté les options utilisateur déjà configurées"""
modifie = False
oldtree = etree.parse(fichier)
oldroot = oldtree.getroot()
newroot = etree.XML(create_config_file())
for element in newroot.iter(tag=etree.Element):
if not len(element):
parents = [element]
e = element.getparent()
while e is not None:
parents.insert(0, e)
e = e.getparent()
oldtag = oldroot
for i in range(1, len(parents)):
if oldtag.find(parents[i].tag) is None and i < len(parents) - 1 :
if i > 1:
etree.SubElement(oldroot.find(parents[i - 1].tag), parents[i].tag)
else:
etree.SubElement(oldroot, parents[i].tag)
oldtag = oldtag.find(parents[i].tag)
else:
oldtag = oldtag.find(parents[i].tag)
if i == len(parents) - 2: oldparent = oldtag
if oldtag is None:
# Ajoute un nouvel item dans le fichier xml
modifie = True
etree.SubElement(oldparent, element.tag).text = element.text
elif oldtag.text != element.text and parents[1].tag != "options":
# Modifie un item existant s'il ne s'agit pas des options
modifie = True
oldtag.text = element.text
if modifie:
f = codecs.open(os.path.join(CONFIGDIR, "pyromaths.xml"), encoding='utf-8', mode='w')
f.write(etree.tostring(indent(oldroot), pretty_print=True, encoding=str))
f.close()
#!/usr/bin/env python3
# Copyright Louis Paternault 2018
#
# This file is part of Pyromaths.
#
# Pyromaths is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyromaths 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 Affero Public License for more details.
#
# You should have received a copy of the GNU Affero Public License
# along with Pyromaths. If not, see <http://www.gnu.org/licenses/>.
import os
import runpy
import sys
sys.path.insert(0, os.path.realpath(os.path.join(os.path.abspath(os.path.dirname(__file__)), os.pardir)))
if __name__ == "__main__":
runpy.run_module("pyromaths.qt", run_name="__main__")
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