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 `models_transients_comments_count.py` resource* 

5 

6:Author: 

7 David Young 

8""" 

9from builtins import object 

10import sys 

11import os 

12import khufu 

13 

14class models_transients_comments_count(object): 

15 """ 

16 The worker class for the models_transients_comments_count module 

17 

18 **Key Arguments** 

19 

20 - ``log`` -- logger 

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

22 - ``elementId`` -- the specific element id requests (or False) 

23  

24 """ 

25 

26 def __init__( 

27 self, 

28 log, 

29 request, 

30 elementId=False 

31 ): 

32 self.log = log 

33 self.request = request 

34 self.elementId = elementId 

35 # xt-self-arg-tmpx 

36 

37 log.debug( 

38 "instansiating a new 'models_transients_comments_count' object") 

39 

40 return None 

41 

42 def close(self): 

43 del self 

44 return None 

45 

46 def count(self): 

47 """execute the count method on the models_transients_comments_count object 

48 

49 **Return** 

50 

51 - ``responseContent`` -- the reponse to send to the browser 

52  

53 """ 

54 self.log.debug('starting the ``count`` method') 

55 

56 # the transientBucketId 

57 elementId = self.elementId 

58 

59 responseContent = "Response from <code>" + __name__ + "</code><BR><BR>" 

60 if elementId: 

61 responseContent = "%(responseContent)sThe element selected was </code>%(elementId)s</code>" % locals( 

62 ) 

63 else: 

64 responseContent = "%(responseContent)sResource Context selected (no element)" % locals( 

65 ) 

66 

67 self.log.debug('completed the ``count`` method') 

68 return responseContent 

69 

70 # xt-class-method