Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# (c) Stefan Countryman, 2019 

2 

3""" 

4Classes associated with generating FileHandler files. 

5""" 

6 

7from collections import namedtuple 

8 

9GenerationResultTuple = namedtuple('GenerationResultTuple', ('fh', 'err')) 

10 

11 

12class GenerationResult(GenerationResultTuple): 

13 """ 

14 The result of a generation attempt. Contains the ``FileHandler`` that 

15 attempted to generate the file, a descriptive message of what happened 

16 during the generation attempt, and, if an uncaught exception terminated the 

17 generation attempt, it contains that exception. 

18 

19 Init Parameters 

20 --------------- 

21 fh : FileHandler 

22 The ``FileHandler`` that attempted to generate its file. 

23 err : BaseException, optional 

24 An uncaught exception that terminated file generation. Set to ``None`` 

25 if no exception was raised. 

26 """ 

27 

28 def __new__(cls, fh, err=None): 

29 return super().__new__(cls, fh, err)