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*
6:Author:
7 David Young
8"""
9from builtins import object
10import sys
11import os
12import khufu
14class models_transients_comments_count(object):
15 """
16 The worker class for the models_transients_comments_count module
18 **Key Arguments**
20 - ``log`` -- logger
21 - ``request`` -- the pyramid request
22 - ``elementId`` -- the specific element id requests (or False)
24 """
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
37 log.debug(
38 "instansiating a new 'models_transients_comments_count' object")
40 return None
42 def close(self):
43 del self
44 return None
46 def count(self):
47 """execute the count method on the models_transients_comments_count object
49 **Return**
51 - ``responseContent`` -- the reponse to send to the browser
53 """
54 self.log.debug('starting the ``count`` method')
56 # the transientBucketId
57 elementId = self.elementId
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 )
67 self.log.debug('completed the ``count`` method')
68 return responseContent
70 # xt-class-method