Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/nbconvert/writers/base.py: 75%

8 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1""" 

2Contains writer base class. 

3""" 

4 

5# Copyright (c) Jupyter Development Team. 

6# Distributed under the terms of the Modified BSD License. 

7 

8from traitlets import List 

9 

10from nbconvert.utils.base import NbConvertBase 

11 

12 

13class WriterBase(NbConvertBase): 

14 """Consumes output from nbconvert export...() methods and writes to a 

15 useful location.""" 

16 

17 files = List( 

18 [], 

19 help=""" 

20 List of the files that the notebook references. Files will be 

21 included with written output.""", 

22 ).tag(config=True) 

23 

24 def __init__(self, config=None, **kw): 

25 """ 

26 Constructor 

27 """ 

28 super().__init__(config=config, **kw) 

29 

30 def write(self, output, resources, **kw): 

31 """ 

32 Consume and write Jinja output. 

33 

34 Parameters 

35 ---------- 

36 output : string 

37 Conversion results. This string contains the file contents of the 

38 converted file. 

39 resources : dict 

40 Resources created and filled by the nbconvert conversion process. 

41 Includes output from preprocessors, such as the extract figure 

42 preprocessor. 

43 """ 

44 

45 raise NotImplementedError()