Skip to content
Extraits de code Groupes Projets
Valider d28ebb8f rédigé par Olivier Bonaventure's avatar Olivier Bonaventure
Parcourir les fichiers

Update to mcq.py to support python3

parent ab51f252
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -339,7 +339,7 @@ def html_add_content(app, doctree, docname): ...@@ -339,7 +339,7 @@ def html_add_content(app, doctree, docname):
builder = app.builder builder = app.builder
if not hasattr(builder, 'format') or builder.format != 'html': if not hasattr(builder, 'format') or builder.format != 'html':
return return
h = hashlib.md5(str(doctree)).hexdigest() h = hashlib.md5(str(doctree).encode('utf-8')).hexdigest()
title = '' title = ''
node = doctree node = doctree
for t in doctree.traverse(nodes.title): for t in doctree.traverse(nodes.title):
...@@ -354,12 +354,12 @@ def html_add_content(app, doctree, docname): ...@@ -354,12 +354,12 @@ def html_add_content(app, doctree, docname):
section += nodes.raw(format='html', text=text) section += nodes.raw(format='html', text=text)
node += section node += section
js = nodes.raw(format='html') js = nodes.raw(format='html')
js += nodes.Text(u'\n<script type="text/javascript">var language = "' + unicode(language) + '";' js += nodes.Text(u'\n<script type="text/javascript">var language = "' + str(language.encode('utf-8')) + '";'
u' var upload_url = "' + unicode(app.config.mcq_upload_url) + '";' u' var upload_url = "' + str(app.config.mcq_upload_url.encode('utf-8')) + '";'
u' var hash = "' + unicode(h) + '"; var title = "' + unicode(title) + '";' u' var hash = "' + str(h.encode('utf-8')) + '"; var title = "' + str(title.encode('utf-8')) + '";'
u' var html_title = "' + unicode(app.config.html_title) + '";') u' var html_title = "' + str(app.config.html_title.encode('utf-8')) + '";')
if app.config.mcq_inginious_url and task_id: if app.config.mcq_inginious_url and task_id:
js += nodes.Text(u' var task_id = "' + unicode(task_id) + '"; var inginious_url = "' + unicode(app.config.mcq_inginious_url) + '";') js += nodes.Text(u' var task_id = "' + str(task_id.encode('utf-8')) + '"; var inginious_url = "' + str(app.config.mcq_inginious_url.encode('utf-8')) + '";')
js += nodes.Text(u'</script>'); js += nodes.Text(u'</script>');
doctree += js doctree += js
......
...@@ -18,6 +18,8 @@ import sys, os ...@@ -18,6 +18,8 @@ import sys, os
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.')) #sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here. # If your documentation needs a minimal Sphinx version, state it here.
...@@ -25,7 +27,7 @@ import sys, os ...@@ -25,7 +27,7 @@ import sys, os
# Add any Sphinx extension module names here, as strings. They can be extensions # Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.todo', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx' ] extensions = ['sphinx.ext.todo', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx', 'sphinxcontrib.spelling' ]
# ucomment # ucomment
#sys.path.append(os.path.abspath(os.getcwd())) #sys.path.append(os.path.abspath(os.getcwd()))
...@@ -105,7 +107,10 @@ rst_epilog = """ ...@@ -105,7 +107,10 @@ rst_epilog = """
# Intersphinx # Intersphinx
intersphinx_mapping = {'theorie': ('https://sites.uclouvain.be/SystInfo/notes/Theorie/html/', None), 'outils': ('https://sites.uclouvain.be/SystInfo/notes/Outils/html/', None), 'exercices': ('https://sites.uclouvain.be/SystInfo/notes/Exercices/html/', None)} intersphinx_mapping = {'theorie': ('https://sites.uclouvain.be/SystInfo/notes/Theorie/html/', None), 'outils': ('https://sites.uclouvain.be/SystInfo/notes/Outils/html/', None), 'exercices': ('https://sites.uclouvain.be/SystInfo/notes/Exercices/html/', None)}
# -- Options for Spelling extension ------------------------------------------
spelling_lang='fr'
spelling_word_list_filename='../dict.txt'
# -- Options for HTML output --------------------------------------------------- # -- Options for HTML output ---------------------------------------------------
......
...@@ -105,10 +105,10 @@ Assertion Définition ...@@ -105,10 +105,10 @@ Assertion Définition
``CU_ASSERT_PTR_NOT_EQUAL(actual, expected)`` Vérifie que le pointeur ``actual`` est différent du pointeur ``expected``. ``CU_ASSERT_PTR_NOT_EQUAL(actual, expected)`` Vérifie que le pointeur ``actual`` est différent du pointeur ``expected``.
``CU_ASSERT_PTR_NULL(value)`` Vérifie que le pointeur est ``NULL``. ``CU_ASSERT_PTR_NULL(value)`` Vérifie que le pointeur est ``NULL``.
``CU_ASSERT_PTR_NOT_NULL(value)`` Vérifie que le pointeur n'est pas ``NULL``. ``CU_ASSERT_PTR_NOT_NULL(value)`` Vérifie que le pointeur n'est pas ``NULL``.
``CU_ASSERT_STRING_EQUAL(actual, expected)`` Vérifie que la chaine de caractère ``actual`` est égale à la chaine de caractère ``expected``. ``CU_ASSERT_STRING_EQUAL(actual, expected)`` Vérifie que la chaîne de caractère ``actual`` est égale à la chaîne de caractère ``expected``.
``CU_ASSERT_STRING_NOT_EQUAL(actual, expected)`` Vérifie que la chaine de caractère ``actual`` n'est pas égale à la chaine de caractère ``expected``. ``CU_ASSERT_STRING_NOT_EQUAL(actual, expected)`` Vérifie que la chaîne de caractère ``actual`` n'est pas égale à la chaîne de caractère ``expected``.
``CU_ASSERT_NSTRING_EQUAL(actual, expected, count)`` Vérifie que les ``count`` premiers caractères de la chaine ``actual`` sont égaux aux ``count`` premiers caractères de la chaine ``expected``. ``CU_ASSERT_NSTRING_EQUAL(actual, expected, count)`` Vérifie que les ``count`` premiers caractères de la chaîne ``actual`` sont égaux aux ``count`` premiers caractères de la chaîne ``expected``.
``CU_ASSERT_NSTRING_NOT_EQUAL(actual, expected, count)`` Vérifie que les ``count`` premiers caractères de la chaine ``actual`` ne sont pas égaux aux ``count`` premiers caractères de la chaine ``expected``. ``CU_ASSERT_NSTRING_NOT_EQUAL(actual, expected, count)`` Vérifie que les ``count`` premiers caractères de la chaîne ``actual`` ne sont pas égaux aux ``count`` premiers caractères de la chaîne ``expected``.
``CU_ASSERT_DOUBLE_EQUAL(actual, expected, granularity)`` Vérifie que ``actual`` et ``expected`` ne diffèrent pas plus que ``granularity`` (:math:`|actual-expected| \leq |granularity|`) ``CU_ASSERT_DOUBLE_EQUAL(actual, expected, granularity)`` Vérifie que ``actual`` et ``expected`` ne diffèrent pas plus que ``granularity`` (:math:`|actual-expected| \leq |granularity|`)
``CU_ASSERT_DOUBLE_NOT_EQUAL(actual, expected, granularity)`` Vérifie que ``actual`` et ``expected`` diffèrent de plus que ``granularity`` (:math:`|actual-expected| > |granularity|`) ``CU_ASSERT_DOUBLE_NOT_EQUAL(actual, expected, granularity)`` Vérifie que ``actual`` et ``expected`` diffèrent de plus que ``granularity`` (:math:`|actual-expected| > |granularity|`)
``CU_PASS(message)`` Ne vérifie rien mais notifie que le test est réussis ``CU_PASS(message)`` Ne vérifie rien mais notifie que le test est réussis
...@@ -273,4 +273,4 @@ suivants : ...@@ -273,4 +273,4 @@ suivants :
2. cunit.c:29 - CU_ASSERT_STRING_EQUAL("string #1","string #2") 2. cunit.c:29 - CU_ASSERT_STRING_EQUAL("string #1","string #2")
Enfin, il est nécessaire de libérer les ressources en appelant Enfin, il est nécessaire de libérer les ressources en appelant
``CU_cleanup_registry()``. ``CU_cleanup_registry()``.
\ No newline at end of file
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Configuration file for the Sphinx documentation builder.
# #
# SINF1252 documentation build configuration file, created by # This file only contains a selection of the most common options. For a full
# sphinx-quickstart on Tue Jan 3 16:17:09 2012. # list see the documentation:
# # https://www.sphinx-doc.org/en/master/usage/configuration.html
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import sys, os # -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory, # If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.')) #
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
# -- General configuration ----------------------------------------------------- import sys, os
# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.todo', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx', 'sphinxcontrib.spelling' ]
# -- Project information -----------------------------------------------------
#spelling
spelling_lang='fr'
spelling_word_list_filename='../dict.txt'
# ucomment extensions = ['sphinx.ext.todo', 'sphinx.ext.ifconfig', 'sphinx.ext.mathjax', 'sphinx.ext.intersphinx', 'sphinxcontrib.spelling' ]
#sys.path.append(os.path.abspath(os.getcwd()))
#extensions.append('ucomment-extension')
#html_translator_class = 'ucomment-extension.ucomment_html_translator'
# Point to your Django application, which contains all project = 'Syllabus C'
# the other settings required. copyright = '2019, Olivier Bonaventure, Gregory Detal, Christoph Paasch'
#ucomment = {} author = 'Olivier Bonaventure, Gregory Detal, Christoph Paasch'
#ucomment['django_application_path'] = '/home/cpaasch/sinf1252/ucommentsite/ucommentapp'
# The full version, including alpha/beta/rc tags
release = '2019'
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix of source filenames. # -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
source_suffix = '.rst' source_suffix = '.rst'
# The encoding of source files. # The encoding of source files.
...@@ -56,8 +47,8 @@ source_encoding = 'utf-8' ...@@ -56,8 +47,8 @@ source_encoding = 'utf-8'
master_doc = 'index' master_doc = 'index'
# General information about the project. # General information about the project.
project = u'LEPL1503 : Introduction au langage C' project = 'LEPL1503 : Introduction au langage C'
copyright = u'2013, 2019, O. Bonaventure, G. Detal, C. Paasch' copyright = '2013, 2019, O. Bonaventure, G. Detal, C. Paasch'
# The version info for the project you're documenting, acts as replacement for # The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the # |version| and |release|, also used in various other places throughout the
...@@ -72,47 +63,31 @@ release = '2019' ...@@ -72,47 +63,31 @@ release = '2019'
# for a list of supported languages. # for a list of supported languages.
language = 'fr' language = 'fr'
# There are two options for replacing |today|: either, you set today to some # Add any paths that contain templates here, relative to this directory.
# non-false value, then it is used: templates_path = ['_templates']
#today = ''
# Else, today_fmt is used as the format for a strftime call. # The language for content autogenerated by Sphinx. Refer to documentation
#today_fmt = '%B %d, %Y' # for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'fr'
# List of patterns, relative to source directory, that match files and # List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files. # directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build/**', '.#*', '**/.#**', 'Exercices/QCM/**', "**.BASE.**", "**.REMOTE.**", "**.LOCAL.**", "**.BACKUP.**", "MemoireVirtuelle/**", "Assembleur/**", "Fichiers/fichiers-signaux.rst", "Threads/processus.rst" ] exclude_patterns = ['_build/**', '.#*', '**/.#**', 'Exercices/QCM/**', "**.BASE.**", "**.REMOTE.**", "**.LOCAL.**", "**.BACKUP.**", "MemoireVirtuelle/**", "Assembleur/**", "Fichiers/fichiers-signaux.rst", "Threads/processus.rst" ]
# The reST default role (used for this markup: `text`) to use for all documents. #rst_prolog = """
#default_role = None #.. include:: /links.rst
#.. include:: /man_links.rst
# If true, '()' will be appended to :func: etc. cross-reference text. #.. include:: /incl_links.rst
#add_function_parentheses = True #"""
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the # recommended to avoid problems with mobi conversion
# output. They are ignored by default. smartquotes=False
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use. # -- Options for HTML output -------------------------------------------------
pygments_style = 'sphinx'
# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
rst_epilog = """
.. include:: /links.rst
.. include:: /man_links.rst
.. include:: /incl_links.rst
"""
# Intersphinx
intersphinx_mapping = {'theorie': ('https://sites.uclouvain.be/SystInfo/notes/Theorie/html/', None), 'outils': ('https://sites.uclouvain.be/SystInfo/notes/Outils/html/', None), 'exercices': ('https://sites.uclouvain.be/SystInfo/notes/Exercices/html/', None)}
# -- Options for HTML output ---------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
...@@ -128,7 +103,7 @@ html_theme = 'haiku' ...@@ -128,7 +103,7 @@ html_theme = 'haiku'
# The name for this set of Sphinx documents. If None, it defaults to # The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation". # "<project> v<release> documentation".
html_title = u'Langage C' html_title = 'Langage C'
# A shorter title for the navigation bar. Default is the same as html_title. # A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None #html_short_title = None
...@@ -163,7 +138,7 @@ html_static_path = ['_static'] ...@@ -163,7 +138,7 @@ html_static_path = ['_static']
#html_additional_pages = {} #html_additional_pages = {}
# If false, no module index is generated. # If false, no module index is generated.
#html_domain_indices = True html_domain_indices = False
# If false, no index is generated. # If false, no index is generated.
#html_use_index = True #html_use_index = True
...@@ -172,7 +147,7 @@ html_static_path = ['_static'] ...@@ -172,7 +147,7 @@ html_static_path = ['_static']
#html_split_index = False #html_split_index = False
# If true, links to the reST sources are added to the pages. # If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True html_show_sourcelink = True
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
#html_show_sphinx = True #html_show_sphinx = True
...@@ -180,17 +155,11 @@ html_static_path = ['_static'] ...@@ -180,17 +155,11 @@ html_static_path = ['_static']
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
#html_show_copyright = True #html_show_copyright = True
# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# This is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = None
# Output file base name for HTML help builder. # -- Options for Spelling extension ------------------------------------------
htmlhelp_basename = 'SINF1252doc'
spelling_lang='fr'
spelling_word_list_filename='../dict.txt'
# -- Options for LaTeX output -------------------------------------------------- # -- Options for LaTeX output --------------------------------------------------
...@@ -202,7 +171,7 @@ latex_elements = { ...@@ -202,7 +171,7 @@ latex_elements = {
'pointsize': '10pt', 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble. # Additional stuff for the LaTeX preamble.
#'preamble': '', 'preamble': '',
'preamble': ''' 'preamble': '''
\\hypersetup{unicode=true} \\hypersetup{unicode=true}
''' '''
...@@ -212,8 +181,8 @@ latex_elements = { ...@@ -212,8 +181,8 @@ latex_elements = {
# Grouping the document tree into LaTeX files. List of tuples # Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]). # (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [ latex_documents = [
('index', 'LEPL1503.tex', u'LEPL1503 : Introduction au langage C', ('index', 'LEPL1503.tex', 'LEPL1503 : Introduction au langage C',
u'O. Bonaventure, G. Detal, C. Paasch', 'manual'), 'O. Bonaventure, G. Detal, C. Paasch', 'manual'),
] ]
# The name of an image file (relative to this directory) to place at the top of # The name of an image file (relative to this directory) to place at the top of
...@@ -234,90 +203,5 @@ latex_documents = [ ...@@ -234,90 +203,5 @@ latex_documents = [
#latex_appendices = [] #latex_appendices = []
# If false, no module index is generated. # If false, no module index is generated.
#latex_domain_indices = True latex_domain_indices = False
# -- Options for manual page output --------------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'sinf1252', u'SINF1252',
[u'O. Bonaventure, G. Detal, C. Paasch'], 1)
]
# If true, show URL addresses after external links.
#man_show_urls = False
# -- Options for Texinfo output ------------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'SINF1252', u'SINF1252 : Systèmes informatiques',
u'O. Bonaventure, G. Detal, C. Paasch', 'SINF1252', 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.
#texinfo_appendices = []
# If false, no module index is generated.
#texinfo_domain_indices = True
# How to display URL addresses: 'footnote', 'no', or 'inline'.
#texinfo_show_urls = 'footnote'
# -- Options for Epub output ---------------------------------------------------
# Bibliographic Dublin Core info.
epub_title = u'LEPL1503 : Introduction au langage C'
epub_author = u'O. Bonaventure, G. Detal, C. Paasch'
epub_publisher = u'O. Bonaventure, G. Detal, C. Paasch'
epub_copyright = u'2013, 2019, O. Bonaventure, G. Detal, C. Paasch'
# The language of the text. It defaults to the language option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
# A tuple containing the cover image and cover page html template filenames.
#epub_cover = ()
# HTML files that should be inserted before the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_pre_files = []
# HTML files shat should be inserted after the pages created by sphinx.
# The format is a list of tuples containing the path and title.
#epub_post_files = []
# A list of files that should not be packed into the epub file.
#epub_exclude_files = []
# The depth of the table of contents in toc.ncx.
#epub_tocdepth = 3
# Allow duplicate toc entries.
#epub_tocdup = True
#try:
# open('.staff','r')
# tags.add('staff')
# print "Build as staff member"
#except:
# print "Build as student"
mathjax_path="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"
...@@ -50,6 +50,8 @@ Systèmes Multiprocesseurs ...@@ -50,6 +50,8 @@ Systèmes Multiprocesseurs
Threads/threads Threads/threads
Threads/threads2 Threads/threads2
Threads/coordination Threads/coordination
.. Threads/processus .. Threads/processus
......
...@@ -11,9 +11,10 @@ cd Theorie ...@@ -11,9 +11,10 @@ cd Theorie
echo "**** Theorie ****" echo "**** Theorie ****"
sphinx-build -nWNT --keep-going -b html . /tmp sphinx-build -nWNT --keep-going -b html . /tmp
sphinx-build -b spelling . /tmp sphinx-build -b spelling . /tmp
#cd ../Outils cd ../Outils
#echo "**** Outils ****" echo "**** Outils ****"
#sphinx-build -nWNT --keep-going -b html . /tmp sphinx-build -nWNT --keep-going -b html . /tmp
sphinx-build -b spelling . /tmp
#cd ../Exercices #cd ../Exercices
#echo "**** Exercices ****" #echo "**** Exercices ****"
#sphinx-build -nWNT --keep-going -b html . /tmp #sphinx-build -nWNT --keep-going -b html . /tmp
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter