Mercurial > p > roundup > code
comparison doc/admin_guide.txt @ 8352:6ea309c6d17c
docs: fix registerutilMethod docs, format for highlights.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Thu, 03 Jul 2025 12:30:21 -0400 |
| parents | 03513f5066f3 |
| children | 0663a7bcef6c |
comparison
equal
deleted
inserted
replaced
| 8351:e775cd258763 | 8352:6ea309c6d17c |
|---|---|
| 491 Setting the header with a value of None will not inject the | 491 Setting the header with a value of None will not inject the |
| 492 header and can override the default set. | 492 header and can override the default set. |
| 493 | 493 |
| 494 Header values will be formatted with a dictionary including a | 494 Header values will be formatted with a dictionary including a |
| 495 nonce. Use to set a nonce for inline scripts. | 495 nonce. Use to set a nonce for inline scripts. |
| 496 | |
| 497 self is an instance of the TemplatingUtilities class, so | |
| 498 you have access to self.client as well as any functions added | |
| 499 using registerUtil. | |
| 496 ''' | 500 ''' |
| 497 try: | 501 try: |
| 498 if self.client.client_nonce is None: | 502 if self.client.client_nonce is None: |
| 499 # logger.warning("client_nonce is None") | 503 # logger.warning("client_nonce is None") |
| 500 self.client.client_nonce = self.client.session_api._gen_sid() | 504 self.client.client_nonce = self.client.session_api._gen_sid() |
| 543 If you are using a version of Roundup before version 2.5, you need to | 547 If you are using a version of Roundup before version 2.5, you need to |
| 544 replace ``instance.registerUtilMethod`` with | 548 replace ``instance.registerUtilMethod`` with |
| 545 ``instance.registerUtil``. For example:: | 549 ``instance.registerUtil``. For example:: |
| 546 | 550 |
| 547 def init(instance): | 551 def init(instance): |
| 548 # Note the use of the new (in version 2.5) registerUtilMethod | |
| 549 instance.registerUtil('AddHtmlHeaders', AddHtmlHeaders) | 552 instance.registerUtil('AddHtmlHeaders', AddHtmlHeaders) |
| 550 | 553 |
| 551 The AddHtmlHeaders function needs to be changed so that ``self.client`` | 554 The AddHtmlHeaders function needs to be changed so that ``self.client`` |
| 552 is replaced by ``client``:: | 555 is replaced by ``client``:: |
| 553 | 556 |
