mathmaker  0.4(alpha)
mathmaker_dev/lib/common/cst.py
00001 # -*- coding: utf-8 -*-
00002 
00003 # Mathmaker creates automatically maths exercises sheets
00004 # with their answers
00005 # Copyright 2006-2014 Nicolas Hainaux <nico_h@users.sourceforge.net>
00006 
00007 # This file is part of Mathmaker.
00008 
00009 # Mathmaker is free software; you can redistribute it and/or modify
00010 # it under the terms of the GNU General Public License as published by
00011 # the Free Software Foundation; either version 3 of the License, or
00012 # any later version.
00013 
00014 # Mathmaker is distributed in the hope that it will be useful,
00015 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 # GNU General Public License for more details.
00018 
00019 # You should have received a copy of the GNU General Public License
00020 # along with Mathmaker; if not, write to the Free Software
00021 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00022 
00023 YES = ['yes', 'Yes', 'YES', 'ok', 'Ok', 'OK', True]
00024 
00025 DEFAULT = "default"
00026 RANDOMLY = "randomly"
00027 NUMERIC = "numeric"
00028 LITERALS = "literals"
00029 OTHERS = "others"
00030 
00031 UNIT = "1"
00032 TENTH = "1.0"
00033 HUNDREDTH = "1.00"
00034 THOUSANDTH = "1.000"
00035 TEN_THOUSANDTH = "1.0000"
00036 
00037 PRECISION = [UNIT, TENTH, HUNDREDTH, THOUSANDTH, TEN_THOUSANDTH]
00038 PRECISION_REVERSED = { UNIT : 0,
00039                        TENTH : 1,
00040                        HUNDREDTH : 2,
00041                        THOUSANDTH : 3,
00042                        TEN_THOUSANDTH : 4
00043                      }
00044 
00045 PRECISION_WORDS = { UNIT : "unit",
00046                     TENTH : "tenth",
00047                     HUNDREDTH : "hundredth",
00048                     THOUSANDTH : "thousandth",
00049                     TEN_THOUSANDTH : "ten thousandth"
00050                   }
00051 
00052 LENGTH_UNITS = ['km', 'hm', 'dam', 'm', 'dm', 'cm', 'mm', 'µm', 'nm', 'pm']
00053 ANGLE_UNITS = ['\\textdegree']
00054 AVAILABLE_UNITS = LENGTH_UNITS + ANGLE_UNITS
00055 VALUE_AND_UNIT_SEPARATOR = {'km':" ",
00056                             'hm':" ",
00057                             'dam':" ",
00058                             'm':" ",
00059                             'dm':" ",
00060                             'cm':" ",
00061                             'mm':" ",
00062                             'µm':" ",
00063                             'nm':" ",
00064                             'pm':" ",
00065                             '\\textdegree':""
00066                             }
00067 
00068 TEXT_SCALES = ['tiny', 'scriptsize', 'footnotesize', 'small', 'normal',
00069                'large', 'Large', 'LARGE', 'huge', 'HUGE']
00070 
00071 TEXT_RANKS = {'tiny':0, 'scriptsize':1, 'footnotesize':2, 'small':3,
00072               'normal':4, 'large':5, 'Large':6, 'LARGE':7, 'huge':8, 'HUGE':9}
00073 
00074 
00075 
00076 
00077