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#!/usr/local/bin/python 

2# encoding: utf-8 

3""" 

4*The HTML template module for the `templates_login.py` resource* 

5 

6:Author: 

7 David Young 

8""" 

9from builtins import object 

10import sys 

11import os 

12import khufu 

13 

14class templates_login(object): 

15 """ 

16 *The worker class for the templates_login module* 

17 

18 **Key Arguments** 

19 

20 - ``log`` -- logger 

21 - ``request`` -- the pyramid request 

22 - ``mainCssFilePath`` -- the filename of the main css file 

23 - ``jsFilePath`` -- the filename of the main js file 

24 - ``pageTitle`` -- pageTitle 

25 - ``icon`` -- webapp icon 

26 - ``came_from`` -- the url this login page was triggered from 

27 - ``message`` -- message to display as notification 

28 """ 

29 # Initialisation 

30 

31 def __init__( 

32 self, 

33 log, 

34 request, 

35 mainCssFilePath="main.css", 

36 jsFilePath="main-ck.js", 

37 pageTitle="Login", 

38 iconPath="", 

39 came_from="/", 

40 message="" 

41 ): 

42 self.log = log 

43 self.request = request 

44 self.mainCssFilePath = mainCssFilePath 

45 self.jsFilePath = jsFilePath 

46 self.pageTitle = pageTitle 

47 self.iconPath = iconPath 

48 self.came_from = came_from 

49 self.message = message 

50 

51 # xt-self-arg-tmpx 

52 

53 log.debug("instansiating a new 'templates_login' object") 

54 

55 # Initial Actions 

56 

57 return None 

58 

59 def close(self): 

60 del self 

61 return None 

62 

63 # Method Attributes 

64 def get(self): 

65 """ 

66 *get the templates_login object* 

67 

68 **Return** 

69 

70 - ``loginPage`` -- the login page 

71 """ 

72 self.log.debug('starting the ``get`` method') 

73 

74 loginPage = khufu.scaffolding.login_page( 

75 log=self.log, 

76 mainCssFilePath=self.mainCssFilePath, 

77 jsFilePath=self.jsFilePath, 

78 pageTitle=self.pageTitle, 

79 iconPath=self.iconPath, 

80 came_from=self.came_from, 

81 message=self.message, 

82 ) 

83 loginPage = loginPage.get() 

84 

85 self.log.debug('completed the ``get`` method') 

86 return loginPage 

87 

88 # xt-class-method