Coverage for cc_modules/cc_resource_registry.py: 57%

1"""

2 camcops_server/cc_modules/cc_resource_registry.py

3

4===============================================================================

5

6 Copyright (C) 2012, University of Cambridge, Department of Psychiatry.

7 Created by Rudolf Cardinal (rnc1001@cam.ac.uk).

8

9 This file is part of CamCOPS.

10

11 CamCOPS is free software: you can redistribute it and/or modify

12 it under the terms of the GNU General Public License as published by

13 the Free Software Foundation, either version 3 of the License, or

14 (at your option) any later version.

15

16 CamCOPS is distributed in the hope that it will be useful,

17 but WITHOUT ANY WARRANTY; without even the implied warranty of

18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

19 GNU General Public License for more details.

20

21 You should have received a copy of the GNU General Public License

22 along with CamCOPS. If not, see <https://www.gnu.org/licenses/>.

23

24===============================================================================

25

26**Deform resource registry class, for HTML forms.**

27

28"""

29

30 from typing import Any

31

32 from deform.widget import ResourceRegistry

33

34

35 class CamcopsResourceRegistry(ResourceRegistry):

36 def __init__(self, *args: Any, **kwargs: Any) -> None:

37 super().__init__(*args, **kwargs)

38

39 self.set_js_resources(

40 "jsoneditor",

41 None,

42 "camcops_server.static:jsoneditor/jsoneditor.min.js",

43 )

44

45 self.set_css_resources(

46 "jsoneditor",

47 None,

48 "camcops_server.static:jsoneditor/jsoneditor.min.css",

49 "camcops_server.static:jsoneditor/jsonwidget.css",

50 )