leveraged_statements
trestle.core.crm.leveraged_statements
¤
Handle writing of inherited statements to markdown.
Attributes¤
component_mapping_default: List[Dict[str, str]] = [{'name': const.REPLACE_ME}]
module-attribute
¤
logger = logging.getLogger(__name__)
module-attribute
¤
Classes¤
InheritanceInfo
dataclass
¤
Class to capture component inheritance information.
Source code in trestle/core/crm/leveraged_statements.py
208 209 210 211 212 213 214 |
|
InheritanceMarkdownReader
¤
Class to read leveraged statement information from Markdown.
Source code in trestle/core/crm/leveraged_statements.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
Functions¤
__init__(leveraged_statement_file)
¤
Initialize the class.
Source code in trestle/core/crm/leveraged_statements.py
220 221 222 223 224 225 226 227 228 229 |
|
get_leveraged_component_header_value()
¤
Provide the leveraged component value in the yaml header.
Source code in trestle/core/crm/leveraged_statements.py
307 308 309 |
|
get_leveraged_ssp_reference()
¤
Return the leveraged SSP reference in the yaml header.
Source code in trestle/core/crm/leveraged_statements.py
287 288 289 |
|
get_provided_description()
¤
Return the provided description in the Markdown.
Source code in trestle/core/crm/leveraged_statements.py
299 300 301 302 303 304 305 |
|
get_satisfied_description()
¤
Return the satisfied description in the Markdown.
Source code in trestle/core/crm/leveraged_statements.py
291 292 293 294 295 296 297 |
|
process_leveraged_statement_markdown()
¤
Read inheritance information from Markdown.
Returns:
Type | Description |
---|---|
Optional[InheritanceInfo]
|
Optional InheritanceInfo - A list of mapped component titles, an optional satisfied statement and an |
Optional[InheritanceInfo]
|
optional inherited statement |
Notes
Returns inheritance information in the context of the leveraging SSP. If no leveraging component titles are mapped in the yaml header None will be returned. The satisfied and inherited fields are generated and returned to added information to by-component assemblies for the mapped leveraging components.
Source code in trestle/core/crm/leveraged_statements.py
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
strip_heading_and_comments(markdown_text)
staticmethod
¤
Remove the heading and comments from lines to get the multi-line paragraph.
Source code in trestle/core/crm/leveraged_statements.py
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
|
LeveragedStatements
¤
Bases: ABC
Abstract class for managing leveraged statements.
Source code in trestle/core/crm/leveraged_statements.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
Attributes¤
header_comment_dict: Dict[str, str] = {const.TRESTLE_LEVERAGING_COMP_TAG: const.YAML_LEVERAGING_COMP_COMMENT, const.TRESTLE_STATEMENT_TAG: const.YAML_LEVERAGED_COMMENT}
instance-attribute
¤
merged_header_dict: Dict[str, Any] = {const.TRESTLE_STATEMENT_TAG: '', const.TRESTLE_LEVERAGING_COMP_TAG: component_mapping_default, const.TRESTLE_GLOBAL_TAG: {const.LEVERAGED_SSP: {const.HREF: leveraged_ssp_reference}}}
instance-attribute
¤
Functions¤
__init__(leveraged_ssp_reference)
¤
Initialize the class.
Source code in trestle/core/crm/leveraged_statements.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
write_statement_md(leveraged_statement_file)
abstractmethod
¤
Write inheritance information to a single markdown file.
Source code in trestle/core/crm/leveraged_statements.py
54 55 56 |
|
StatementProvided
¤
Bases: LeveragedStatements
Concrete class for managing provided statements.
Source code in trestle/core/crm/leveraged_statements.py
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
Attributes¤
provided_description = provided_description
instance-attribute
¤
provided_uuid = provided_uuid
instance-attribute
¤
Functions¤
__init__(provided_uuid, provided_description, leveraged_ssp_reference)
¤
Initialize the class.
Source code in trestle/core/crm/leveraged_statements.py
121 122 123 124 125 126 127 128 129 130 |
|
update_statement_md(leveraged_statement_file)
¤
Update provided statements in a markdown file.
Source code in trestle/core/crm/leveraged_statements.py
142 143 144 145 146 147 148 149 |
|
write_statement_md(leveraged_statement_file)
¤
Write provided statements to a markdown file.
Source code in trestle/core/crm/leveraged_statements.py
132 133 134 135 136 137 138 139 140 |
|
StatementResponsibility
¤
Bases: LeveragedStatements
Concrete class for managing responsibility statements.
Source code in trestle/core/crm/leveraged_statements.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
Attributes¤
responsibility_description = responsibility_description
instance-attribute
¤
responsibility_uuid = responsibility_uuid
instance-attribute
¤
satisfied_description = ''
instance-attribute
¤
Functions¤
__init__(responsibility_uuid, responsibility_description, leveraged_ssp_reference)
¤
Initialize the class.
Source code in trestle/core/crm/leveraged_statements.py
162 163 164 165 166 167 168 169 170 171 172 |
|
update_statement_md(leveraged_statement_file)
¤
Update responsibility statements in a markdown file.
Source code in trestle/core/crm/leveraged_statements.py
184 185 186 187 188 189 190 191 192 193 194 195 |
|
write_statement_md(leveraged_statement_file)
¤
Write responsibility statements to a markdown file.
Source code in trestle/core/crm/leveraged_statements.py
174 175 176 177 178 179 180 181 182 |
|
StatementTree
¤
Bases: LeveragedStatements
Concrete class for managing provided and responsibility statements.
Source code in trestle/core/crm/leveraged_statements.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
Attributes¤
provided_description = provided_description
instance-attribute
¤
provided_uuid = provided_uuid
instance-attribute
¤
responsibility_description = responsibility_description
instance-attribute
¤
responsibility_uuid = responsibility_uuid
instance-attribute
¤
satisfied_description = ''
instance-attribute
¤
Functions¤
__init__(provided_uuid, provided_description, responsibility_uuid, responsibility_description, leveraged_ssp_reference)
¤
Initialize the class.
Source code in trestle/core/crm/leveraged_statements.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
update_statement_md(leveraged_statement_file)
¤
Update provided and responsibility statements in a markdown file.
Source code in trestle/core/crm/leveraged_statements.py
88 89 90 91 92 93 94 95 96 97 98 99 |
|
write_statement_md(leveraged_statement_file)
¤
Write a provided and responsibility statements to a markdown file.
Source code in trestle/core/crm/leveraged_statements.py
78 79 80 81 82 83 84 85 86 |
|
handler: python