Peano
Loading...
Searching...
No Matches
CompileMode.py
Go to the documentation of this file.
1
# This file is part of the Peano project. For conditions of distribution and
2
# use, please see the copyright notice at www.peano-framework.org
3
from
enum
import
Enum
4
5
class
CompileMode
(Enum):
6
"""!
7
8
Compile modi
9
10
The compile mode is required in my get_library() routines. It is also used
11
in the Makefile template. You can use CompileModes for a list (overview) of
12
all available modes. string_to_mode() finally helps you to translate a
13
string representation into an actual modus.
14
15
"""
16
DEBUG = 0
17
TRACE = 1
18
ASSERTS = 2
19
RELEASE = 3
20
STATS = 4
21
22
23
"""!
24
25
Overview over all compile modes available
26
27
Is often used within the argument parser:
28
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29
parser.add_argument("-m", "--mode", dest="mode", choices=peano4.api.output.CompileModes, default=peano4.api.output.CompileModes[0], help="|".join(peano4.api.output.CompileModes) )
30
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31
32
"""
33
CompileModes = [
"RELEASE"
,
"STATS"
,
"TRACE"
,
"ASSERTS"
,
"DEBUG"
]
34
35
36
37
"""!
38
39
Convert a string into a compile mode
40
41
"""
42
def
string_to_mode(mode: CompileModes):
43
if
mode==CompileModes[0]:
44
return
CompileMode.RELEASE
45
if
mode==CompileModes[1]:
46
return
CompileMode.STATS
47
if
mode==CompileModes[2]:
48
return
CompileMode.TRACE
49
if
mode==CompileModes[3]:
50
return
CompileMode.ASSERTS
51
if
mode==CompileModes[4]:
52
return
CompileMode.DEBUG
53
raise
Exception(
"mode {} not supported"
.format(mode) )
peano4.api.output.CompileMode.CompileMode
Compile modi.
Definition
CompileMode.py:5
src
peano4
api
output
CompileMode.py
Generated on Wed Nov 4 2026 08:20:47 for Peano by
1.9.8