-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgen_settings.py
More file actions
43 lines (38 loc) · 983 Bytes
/
Copy pathgen_settings.py
File metadata and controls
43 lines (38 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- coding: utf-8 -*- vim:sw=2
PYTHONSOLLYA_VERSION = "\"0.4.0\""
sollya_settings = [
"prec",
"points",
"diam",
"display",
"verbosity",
"canonical",
"autosimplify",
"fullparentheses",
"showmessagenumbers",
"taylorrecursions",
"timing",
"midpointmode",
"dieonerrormode",
"rationalmode",
"roundingwarnings",
"hopitalrecursions",
]
print("cdef class __Settings0(object):")
for name in sollya_settings:
print(r"""
property {name}:
def __get__(self):
return wrap(sollya_lib_get_{name}())
def __set__(self, value):
sollya_lib_set_{name}(as_SollyaObject(value).value)
def __del__(self):
cdef sollya_obj_t default = sollya_lib_default()
sollya_lib_set_{name}(default)
sollya_lib_clear_obj(default)
""".format(name=name))
print(r"""
property __version__:
def __get__(self):
return {version}
""".format(version=PYTHONSOLLYA_VERSION))