From 40d6e12b41a831ab4d29d949ac2cdfdc29cf1a51 Mon Sep 17 00:00:00 2001 From: km0 Date: Fri, 7 Apr 2023 19:39:50 +0200 Subject: [PATCH] guess what codehilite broke notes and pplaceholders --- chapters/02_backdoors.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/chapters/02_backdoors.md b/chapters/02_backdoors.md index 7d1ed66..eb46c2e 100644 --- a/chapters/02_backdoors.md +++ b/chapters/02_backdoors.md @@ -220,9 +220,9 @@ The system is written in Python, and its code documentation consists mainly of _ A _docstring_ is a piece of text written at the very beginning of a function to document it. Unlike normal comments, that are usually stripped out from code at runtime, _docstrings_ are preserved, and can be consulted with interactive help systems or used as metadata. Many programming languages support this pattern, that is often used to produce automatic pieces of documentation by simply collecting and listing all the functions and relative descriptions. +In the project these are used to create a world around the code and its structure: in the initial menu, for example, they are used as scenography for the Screenless Office. Reading it we discover how the office is organized in different _bureau_, each dedicated to a specific task. The _Pubblications Office_ deals with daily news and weather forecast, the _Public Relations_ department manage exchanges with social platforms, the _Audio Service Dept._ provides for playback soundtrack, and so on, with the _Inhuman Resources bureau_ keeping track of them all. -``` -#!python +```python class Humor(Bureau): """ This bureau entertains the modern worker and provides colorful @@ -244,10 +244,11 @@ class Humor(Bureau): jux = str(subprocess.check_output("/usr/games/fortune"), encoding="UTF-8") self.print_small(jux) ``` +Sample from `jokes.py`, the module of the _Department of Humor_. Here two _docstrings_ describe the bureau itself and the `joke` command. ![The Screenless Office menu printed during a workshop at XPUB](../img/2022-04-04-brendan_humor.jpg) +Menu printed by the Inhuman Resources bureau using the docstrings from the other offices, ready to be invoked with the barcode-scanner. -In the project these are used to create a world around the code and its structure: in the initial menu, for example, they are used as scenography for the Screenless Office. Reading it we discover how the office is organized in different _bureau_, each dedicated to a specific task. The _Pubblications Office_ deals with daily news and weather forecast, the _Public Relations_ department manage exchanges with social platforms, the _Audio Service Dept._ provides for playback soundtrack, and so on, with the _Inhuman Resources bureau_ keeping track of them all. - versioning tiger dingusun and the chimeric worlding