File tree 2 files changed +9
-21
lines changed
2 files changed +9
-21
lines changed Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
+ # pylint: disable=import-outside-toplevel
2
3
3
4
"""
4
5
Utilities for working with Jinja2 templates
5
6
"""
6
7
7
8
import os
8
9
9
- from jinja2 import Environment , FileSystemLoader
10
-
11
10
from ..utils import osutils
12
11
from ..version import version
13
12
from . import config
@@ -41,6 +40,8 @@ def __init__(self, template_dirs=None):
41
40
Args:
42
41
template_dirs (list): Absolute path to template directories
43
42
"""
43
+ from jinja2 import Environment , FileSystemLoader
44
+
44
45
tmpl1 = template_dirs or []
45
46
tmpl2 = get_template_dirs ()
46
47
all_templates = tmpl1 + tmpl2
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
+ # pylint: disable=import-outside-toplevel
2
3
3
4
"""\
4
5
Wrappers for VTK/pyvista
5
6
"""
6
7
7
- try :
8
- import vtk as _vtk
9
-
10
- _has_vtk = True
11
- except ImportError : # pragma: no cover
12
- _has_vtk = False
13
-
14
- try :
15
- import pyvista as _pyvista
16
-
17
- _has_pyvista = True
18
- except ImportError : # pragma: no cover
19
- _has_pyvista = False
20
-
21
8
22
9
def vtk ():
23
10
"""Return the vtk module"""
24
- if not _has_vtk : # pragma: no cover
25
- raise ModuleNotFoundError ( "Cannot locate vtk module" )
11
+ import vtk as _vtk
12
+
26
13
return _vtk
27
14
28
15
29
16
def pyvista ():
30
17
"""Return the pyvista module"""
31
- if not _has_pyvista : # pragma: no cover
32
- raise ModuleNotFoundError ( "Cannot locate pyvista module" )
33
- return _pyvista
18
+ import pyvista as pv
19
+
20
+ return pv
You can’t perform that action at this time.
0 commit comments