File: runtime.py

package info (click to toggle)
yade 2025.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,308 kB
  • sloc: cpp: 93,298; python: 50,409; sh: 577; makefile: 162
file content (15 lines) | stat: -rw-r--r-- 686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# this module is populated at initialization from the c++ part of PythonUI
"""Runtime variables, populated at yade startup."""
# default value
hasDisplay = False

# find out about which ipython version we use -- 0.10* and 0.11 are supported, but they have different internals
import IPython
try:  # attempt to get numerical version
	ipython_version = int(IPython.__version__.split('.')[0]) * 100 + int(IPython.__version__.split('.')[1])
except ValueError:
	print('WARN: unable to extract IPython version from %s, defaulting to 10' % (IPython.__version__))
	ipython_version = 10
if (ipython_version < 10):  #set version 10 for very old systems
	newipver = 10
	ipython_version = newipver