py-yprinciple-gen API Documentation
genapi
Created on 2023-01-30
@author: wf
GeneratorAPI
generator API e.g. to be used as a
command line generator
Source code in yprinciple/genapi.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 116 117 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 157 158 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 206 207 208 209 210 211 212 213 214 215 216 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 |
|
__init__(verbose=True, debug=False)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
verbose(bool) |
if True show verbose messages |
required | |
debug(bool) |
if True switch debugging on |
required |
Source code in yprinciple/genapi.py
27 28 29 30 31 32 33 34 35 36 37 |
|
filterTargets(target_names=None)
filter targets by a list of target_names
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_names(list) |
an optional list of target names |
required |
Returns:
Name | Type | Description |
---|---|---|
dict |
dict
|
mapping from target names to targets |
Source code in yprinciple/genapi.py
92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
|
fromArgs(args)
classmethod
create a GeneratorAPI for the given command line arguments
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
command line arguments |
required |
Returns:
Name | Type | Description |
---|---|---|
GeneratorAPI |
GeneratorAPI
|
|
Source code in yprinciple/genapi.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
generateToFile(target_dir=None, target_names=None, topic_names=None, dryRun=True, withEditor=False)
start the generation via MediaWiki Backup Directory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_dir(str) |
the path to the target directory |
required | |
target_names(list) |
an optional list of target names |
required | |
topic_name(list) |
an optional list of topic names |
required | |
dryRun(bool) |
if True do not transfer results |
required | |
withEditor(bool) |
if True - start editor |
required |
Return
list(FileGenResult): a list of File Generator Results
Source code in yprinciple/genapi.py
208 209 210 211 212 213 214 215 216 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 |
|
generateViaMwApi(target_names=None, topic_names=None, dryRun=True, withEditor=False)
start the generation via MediaWiki API
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_names(list) |
an optional list of target names |
required | |
topic_name(list) |
an optional list of topic names |
required | |
dryRun(bool) |
if True do not transfer results |
required | |
withEditor(bool) |
if True - start editor |
required |
Return
list(MwGenResult): a list of Mediawiki Generator Results
Source code in yprinciple/genapi.py
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 206 |
|
handleFailure(ypCell, ex)
handle the given failure
Source code in yprinciple/genapi.py
160 161 162 163 164 165 166 167 168 169 170 |
|
push()
push according to my command line args
Source code in yprinciple/genapi.py
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 |
|
readContext(wikiId, context_name)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
wikiId(str) |
the wikiId of the wiki to read the context from |
required | |
context_name |
str
|
the name of the context to read |
required |
Source code in yprinciple/genapi.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
setWikiAndGetContexts(args)
set my wiki and get Contexts for the given args
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
command line arguments |
required |
Source code in yprinciple/genapi.py
63 64 65 66 67 68 69 70 71 72 73 74 |
|
yieldYpCells(hint, target_names=None, topic_names=None, with_subcells=True)
generate/yield topics and targets via nested loop
Parameters:
Name | Type | Description | Default |
---|---|---|---|
hint(str) |
hint message to show how the yield is used |
required | |
with_subcells |
bool
|
if True yield sub cells (one level) |
True
|
target_name(list) |
if set filter targets by name |
required | |
topic_names(list) |
if set filter topics by name |
required |
Returns: generator(YpCell)
Source code in yprinciple/genapi.py
112 113 114 115 116 117 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 157 158 |
|
gengrid
Created on 25.11.2022
@author: wf
GeneratorGrid
generator and selection grid
see https://wiki.bitplan.com/index.php/Y-Prinzip#Example
Source code in yprinciple/gengrid.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 116 117 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 157 158 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 206 207 208 209 210 211 212 213 214 215 216 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 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 |
|
__init__(targets, parent, solution, iconSize='32px')
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
targets(dict) |
a list of targets |
required | |
parent |
the parent element |
required | |
solution(WebSolution) |
the solution |
required |
Source code in yprinciple/gengrid.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
add_header_cell(title)
add a header cell with the given title
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title(str) |
the title of the cell |
required |
Source code in yprinciple/gengrid.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
add_topic_cell(topic)
add an icon for the given topic
Source code in yprinciple/gengrid.py
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 |
|
add_topic_rows(context)
add the topic rows for the given context
Parameters:
Name | Type | Description | Default |
---|---|---|---|
context(Context) |
the context for which do add topic rows |
required |
Source code in yprinciple/gengrid.py
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
|
add_yp_cell(parent, ypCell)
add the given ypCell
Source code in yprinciple/gengrid.py
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 |
|
check_ypcell_box(checkbox, ypCell, checked)
check the given checkbox and the ypCell belonging to it
Source code in yprinciple/gengrid.py
215 216 217 218 219 220 |
|
create_check_box_for_cell(yp_cell, parent, columns=1)
create a nicegui CheckBox for the given YpCell
Parameters:
Name | Type | Description | Default |
---|---|---|---|
yp_cell |
YpCell
|
YpCell - the YpCell to create a checkbox for |
required |
parent |
the nicegui parent element |
required |
Returns:
Type | Description |
---|---|
checkbox
|
ui.checkbox: The created NiceGUI checkbox element. |
Source code in yprinciple/gengrid.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
|
create_simple_checkbox(parent, label_text, title, classes=None, on_change=None, **kwargs)
Create a NiceGUI checkbox with a label and optional tooltip, adding it to the specified parent container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
parent |
The parent UI element to attach the checkbox to. Must be a NiceGUI container. |
required | |
label_text |
str
|
The text label to display next to the checkbox. |
required |
title |
str
|
The tooltip text to display when hovering over the checkbox. |
required |
classes |
str
|
CSS classes for additional styling. If None, uses a default. |
None
|
**kwargs |
Additional keyword arguments to pass to the checkbox. |
{}
|
Returns:
Type | Description |
---|---|
ui.checkbox: The created checkbox instance. |
Source code in yprinciple/gengrid.py
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
|
getCheckedYpCells()
get all checked YpCells
Source code in yprinciple/gengrid.py
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
get_colums(target)
get the number of columns for the given target
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target(Target) |
the target |
required |
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
the number of columns to be displayed |
Source code in yprinciple/gengrid.py
306 307 308 309 310 311 312 313 314 315 316 317 |
|
get_select(args)
get the select from the sender's tooltip
Source code in yprinciple/gengrid.py
245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
|
onGenerateButtonClick(_msg)
async
react on the generate button having been clicked
Source code in yprinciple/gengrid.py
205 206 207 208 209 210 211 212 213 |
|
onParentCheckboxClick(args)
async
a ypCell checkbox has been clicked for a ypCell that has subCells
Source code in yprinciple/gengrid.py
287 288 289 290 291 292 293 294 295 296 |
|
on_select_all(args)
async
react on "select all" being clicked
Source code in yprinciple/gengrid.py
233 234 235 236 237 238 239 240 241 242 243 |
|
on_select_column(args)
async
react on "select all " for a column being clicked
Source code in yprinciple/gengrid.py
260 261 262 263 264 265 266 267 268 269 270 271 272 |
|
on_select_row(args)
async
react on "select all " for a row being clicked
Source code in yprinciple/gengrid.py
274 275 276 277 278 279 280 281 282 283 284 285 |
|
set_hide_show_status_of_cell_debug_msg(hidden=False)
Sets the hidden status of all cell debug messages Args: hidden: If True hide debug messages else show them
Source code in yprinciple/gengrid.py
490 491 492 493 494 495 496 497 498 499 500 501 502 |
|
setup_styles()
setup the styles for the ui
Source code in yprinciple/gengrid.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
|
setup_target_header_row()
setup the header row
Source code in yprinciple/gengrid.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
setup_topic_header_row()
setup the second header row
Source code in yprinciple/gengrid.py
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 |
|
setup_ui()
setup the user interface
Source code in yprinciple/gengrid.py
52 53 54 55 56 57 58 59 60 61 62 |
|
updateProgress()
update the progress
Source code in yprinciple/gengrid.py
428 429 430 431 432 433 |
|
profiler
Created on 2022-11-18
@author: wf
Profiler
simple profiler
Source code in yprinciple/profiler.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
__init__(msg, profile=True)
construct me with the given msg and profile active flag
Parameters:
Name | Type | Description | Default |
---|---|---|---|
msg(str) |
the message to show if profiling is active |
required | |
profile(bool) |
True if messages should be shown |
required |
Source code in yprinciple/profiler.py
15 16 17 18 19 20 21 22 23 24 25 26 27 |
|
time(extraMsg='')
time the action and print if profile is active
Source code in yprinciple/profiler.py
29 30 31 32 33 34 35 36 |
|
smw_targets
Created on 2022-11-26
@author: wf
CategoryTarget
Bases: SMWTarget
the target to generate "Category" pages
see https://wiki.bitplan.com/index.php/SiDIFTemplates#category
Source code in yprinciple/smw_targets.py
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 |
|
generate(topic)
generate a category page for the given topic
e.g. https://wiki.bitplan.com/index.php/Category:Topic
see https://wiki.bitplan.com/index.php/SiDIFTemplates#category
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate wiki markup for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the generated wiki markup |
Source code in yprinciple/smw_targets.py
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 |
|
ConceptTarget
Bases: SMWTarget
the target to generate "Concept" pages
see https://wiki.bitplan.com/index.php/SiDIFTemplates#concept
Source code in yprinciple/smw_targets.py
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 336 337 338 339 340 341 342 343 344 345 |
|
generate(topic)
generate a result for the given topic
see https://wiki.bitplan.com/index.php/SiDIFTemplates#concept
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic(Topic) |
the topic to generate wiki markup for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the generated wiki markup |
Source code in yprinciple/smw_targets.py
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 336 337 338 339 340 341 342 343 344 345 |
|
FormTarget
Bases: SMWTarget
the target to generate "Form" pages e.g. https://wiki.bitplan.com/index.php/Form:Topic
see https://wiki.bitplan.com/index.php/SiDIFTemplates#form
Source code in yprinciple/smw_targets.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
|
formTemplate(topic, isMultiple)
create the SMW pagefomrs markups for the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to create the markup for |
required |
isMultiple |
bool
|
True if there are multiple values allowed |
required |
Source code in yprinciple/smw_targets.py
400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 |
|
generate(topic)
generate the form page for the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate wiki markup for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the generated wiki markup |
Source code in yprinciple/smw_targets.py
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 |
|
HelpTarget
Bases: SMWTarget
the help Target
Source code in yprinciple/smw_targets.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
generate(topic)
generate a result for the given topic
see https://wiki.bitplan.com/index.php/SiDIFTemplates#help
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate wiki markup for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the generated wiki markup |
Source code in yprinciple/smw_targets.py
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
ListOfTarget
Bases: SMWTarget
the target to generate "List of" pages e.g. https://wiki.bitplan.com/index.php/List_of_Topics
see https://wiki.bitplan.com/index.php/SiDIFTemplates#listof
Source code in yprinciple/smw_targets.py
503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
|
generate(topic)
generate the list of page for the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate wiki markup for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the generated wiki markup |
Source code in yprinciple/smw_targets.py
516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 |
|
PropertyMultiTarget
Bases: SMWTarget
the Property Multi Target
Source code in yprinciple/smw_targets.py
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 |
|
addSubCells(ypCell, topic, debug=False)
add the subcells for the given ypCell and topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ypCell |
YpCell
|
the ypCell |
required |
topic |
Topic
|
the topic to add subcells for |
required |
Source code in yprinciple/smw_targets.py
666 667 668 669 670 671 672 673 674 675 676 677 678 |
|
PropertyTarget
Bases: SMWTarget
the Property Target
Source code in yprinciple/smw_targets.py
681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
|
generate(prop)
generate wiki markup for the given property
see https://wiki.bitplan.com/index.php/SiDIFTemplates#propertiesdefs
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the wiki markup for the given property |
Source code in yprinciple/smw_targets.py
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 |
|
getPageTitle(prop)
get the page title for the given property
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prop |
the Property to get the page title for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the markup |
Source code in yprinciple/smw_targets.py
686 687 688 689 690 691 692 693 694 695 696 697 |
|
PythonTarget
Bases: SMWTarget
generator for Python Code for a Topic
Source code in yprinciple/smw_targets.py
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 |
|
generate(topic)
generate python code for the given topic
Source code in yprinciple/smw_targets.py
773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 |
|
pythonPropType(prop)
get the python property type for the given Property
Source code in yprinciple/smw_targets.py
760 761 762 763 764 765 766 767 768 769 770 771 |
|
SMWTarget
Bases: Target
a specialized generation target for Semantic MediaWiki
Source code in yprinciple/smw_targets.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 116 117 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 157 158 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 206 207 208 209 210 211 212 213 214 215 216 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 |
|
bitplanumlci(fontSize=12)
create plantuml skin params for BITPlan corporate identity
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fontSize |
int
|
the font size to use |
12
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the wiki markup to be generated |
Source code in yprinciple/smw_targets.py
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 157 158 159 160 161 162 163 164 165 166 167 168 |
|
copyright()
get the copyright markup
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the copyright markup |
Source code in yprinciple/smw_targets.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
getSMWTargets()
classmethod
define the targets
Source code in yprinciple/smw_targets.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
i18n(text)
return the internationalized version of the given text
Parameters:
Name | Type | Description | Default |
---|---|---|---|
text |
str
|
the text to internationalize |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the internationalized version of the text |
Source code in yprinciple/smw_targets.py
44 45 46 47 48 49 50 51 52 53 54 55 |
|
plantUmlClass(topic)
get the plantuml markup for the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate uml for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the plantuml markup to be generated |
Source code in yprinciple/smw_targets.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
|
plantUmlRelation(topicLink)
generate wiki markup for a TopicLink/relation
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topicLink |
TopicLink
|
the topicLink to generate the relation for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the wiki markup to generate |
Source code in yprinciple/smw_targets.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
|
profiWiki()
markup for profiWiki
Source code in yprinciple/smw_targets.py
120 121 122 123 124 125 126 127 |
|
seealso(topic)
generate wiki markup to to show relevant links for a topic
Source code in yprinciple/smw_targets.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
topicHeader(topic)
get the topic header for the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate a header for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the markup to be generated |
Source code in yprinciple/smw_targets.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
|
uml(title, topic, output_format='svg')
get the full uml (plantuml) markup for the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate uml for |
required |
output_format |
str
|
the output format to use - default: svg |
'svg'
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the plantuml markup to be generated |
Source code in yprinciple/smw_targets.py
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 |
|
TemplateTarget
Bases: SMWTarget
the template Target
Source code in yprinciple/smw_targets.py
537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
|
generate(topic)
generate a template for the given topic
see https://wiki.bitplan.com/index.php/SiDIFTemplates#template
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate wiki markup for |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the generated wiki markup |
Source code in yprinciple/smw_targets.py
557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 |
|
generateTopicCall(topic)
generate the markup for the template call of the given topic
Parameters:
Name | Type | Description | Default |
---|---|---|---|
topic |
Topic
|
the topic to generate wiki markup for |
required |
Source code in yprinciple/smw_targets.py
542 543 544 545 546 547 548 549 550 551 552 553 554 555 |
|
target
Created on 2022-11-25
@author: wf
Target
a generator Target on the technical side of the Y-Principle
Source code in yprinciple/target.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
__init__(name, icon_name='bullseye', is_multi=False, is_subtarget=False, showInGrid=True)
constructor name (str): the name of the target icon_name (str): the icon_name of the target is_multi(bool): if True this target creates a list of results (has subtargets) showInGrid (bool): if True this target is to be shown in the generator Grid
Source code in yprinciple/target.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
getFileName(modelElement, purpose, fixcolon=False)
get the filename for the given modelElement and purpose
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modelElement |
|
required | |
purpose |
str
|
the purpose e.g. Help/Category ... |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
a file name |
Source code in yprinciple/target.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|
version
Created on 2022-04-01
@author: wf
Version
dataclass
Bases: object
Version handling for pysotsog
Source code in yprinciple/version.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
ypcell
Created on 2022-11-25
@author: wf
GenResult
dataclass
generator Result
Source code in yprinciple/ypcell.py
20 21 22 23 24 25 26 27 |
|
MwGenResult
dataclass
Bases: GenResult
Source code in yprinciple/ypcell.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
getDiffUrl()
get the diff url of the two pages (if any)
Returns:
Name | Type | Description |
---|---|---|
str |
Union[str, None]
|
the url of the diff |
Source code in yprinciple/ypcell.py
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
page_changed()
Check if changes were applied to the new page Returns: bool: True if the content of the page changed otherwise False
Source code in yprinciple/ypcell.py
54 55 56 57 58 59 60 61 62 |
|
YpCell
a Y-Principle cell
Source code in yprinciple/ypcell.py
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 116 117 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 157 158 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 206 207 208 209 210 211 212 213 214 215 216 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 |
|
__init__(modelElement, target, debug=False)
constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
modelElement |
modelElement
|
the modelElement to generate for |
required |
target |
Target
|
the target to generate for |
required |
debug |
bool
|
if True - enable debugging |
False
|
Source code in yprinciple/ypcell.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
createYpCell(target, topic, debug=False)
classmethod
add a ypCell for the given target and topic
Source code in yprinciple/ypcell.py
93 94 95 96 97 98 99 100 101 102 103 |
|
generateMarkup(withEditor=False)
generate the markup
Parameters:
Name | Type | Description | Default |
---|---|---|---|
withEditor |
bool
|
if True open Editor when in dry Run mode |
False
|
Returns:
Name | Type | Description |
---|---|---|
str |
the markup |
Source code in yprinciple/ypcell.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
generateToFile(target_dir, dryRun=True, withEditor=False)
generate the given cell and store the result to a file in the given target directory
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target_dir |
str
|
path to the target directory |
required |
dryRun |
bool
|
if True do not push the result |
True
|
withEditor |
bool
|
if True open Editor when in dry Run mode |
False
|
Returns:
Name | Type | Description |
---|---|---|
FileGenResult |
FileGenResult
|
the generated result |
Source code in yprinciple/ypcell.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
generateViaMwApi(smwAccess=None, dryRun=True, withEditor=False)
generate the given cell and upload the result via the given Semantic MediaWiki Access
Parameters:
Name | Type | Description | Default |
---|---|---|---|
smwAccess |
SMWAccess
|
the access to use |
None
|
dryRun |
bool
|
if True do not push the result |
True
|
withEditor |
bool
|
if True open Editor when in dry Run mode |
False
|
Returns:
Name | Type | Description |
---|---|---|
MwGenResult |
Union[MwGenResult, None]
|
|
None |
Union[MwGenResult, None]
|
if target is multi |
Source code in yprinciple/ypcell.py
155 156 157 158 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 |
|
getLabelText()
get my label Text
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
a label in the generator grid for my modelElement |
Source code in yprinciple/ypcell.py
201 202 203 204 205 206 207 208 |
|
getPage(smwAccess)
get the pageText and status for the given smwAccess
Parameters:
Name | Type | Description | Default |
---|---|---|---|
smwAccess(SMWAccess) |
the Semantic Mediawiki access to use |
required |
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
the wiki markup for this cell (if any) |
Source code in yprinciple/ypcell.py
216 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 |
|
getPageTitle()
get the page title for my modelElement
Source code in yprinciple/ypcell.py
210 211 212 213 214 |
|
ypgen
Created on 2022-11-24
@author: wf
YPGen
Bases: WebserverCmd
Y-Principle Generator Command Line
Source code in yprinciple/ypgen.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
getArgParser(description, version_msg)
Setup command line argument parser
Parameters:
Name | Type | Description | Default |
---|---|---|---|
description |
str
|
the description |
required |
version_msg |
str
|
the version message |
required |
Returns:
Name | Type | Description |
---|---|---|
ArgumentParser |
ArgumentParser
|
the argument parser |
Source code in yprinciple/ypgen.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 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 |
|
handle_args()
work on the arguments
Source code in yprinciple/ypgen.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
main(argv=None)
main call
Source code in yprinciple/ypgen.py
136 137 138 139 140 141 142 143 144 145 |
|
ypgenapp
Created on 2022-11-24
@author: wf
YPGenApp
Bases: InputWebSolution
Y-Principle Generator Web Application / Solution
Source code in yprinciple/ypgenapp.py
58 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 116 117 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 157 158 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 206 207 208 209 210 211 212 213 214 215 216 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 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
|
__init__(webserver, client)
Initializes the InputWebSolution instance with the webserver and client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
webserver |
NiceGuiWebserver
|
The webserver instance this solution is part of. |
required |
client |
Client
|
The client interacting with this solution. |
required |
Source code in yprinciple/ypgenapp.py
63 64 65 66 67 68 69 70 71 |
|
addLanguageSelect()
add a language selector
Source code in yprinciple/ypgenapp.py
227 228 229 230 231 232 233 234 235 236 237 238 |
|
addWikiSelect()
add a wiki selector
Source code in yprinciple/ypgenapp.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
add_context_select()
add a selection of possible contexts for the given wiki
Source code in yprinciple/ypgenapp.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
|
async_showGenerateGrid()
async
run setup in background
Source code in yprinciple/ypgenapp.py
162 163 164 165 166 |
|
clearErrors()
clear log entries
Source code in yprinciple/ypgenapp.py
73 74 75 76 77 |
|
configure_settings()
override settings
Source code in yprinciple/ypgenapp.py
317 318 319 320 321 322 323 |
|
handleHideShowSizeInfo(msg)
handles switching visibility of size information
Source code in yprinciple/ypgenapp.py
266 267 268 269 270 271 |
|
home()
async
provide the main content / home page
home page
Source code in yprinciple/ypgenapp.py
369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
|
load_home_page()
async
back ground preparation
Source code in yprinciple/ypgenapp.py
358 359 360 361 362 363 364 365 366 367 |
|
onChangeContext(msg)
async
react on the context being changed via a Select control
Source code in yprinciple/ypgenapp.py
212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|
onChangeLanguage(msg)
async
react on language being changed via Select control
Source code in yprinciple/ypgenapp.py
191 192 193 194 195 |
|
onChangeWiki(e)
async
react on a the wiki being changed via a Select control
Source code in yprinciple/ypgenapp.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
|
prepare_ui()
prepare the user interface
Source code in yprinciple/ypgenapp.py
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 |
|
setContext(mw_context)
set the Context
Source code in yprinciple/ypgenapp.py
143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
setGenApiFromArgs(args=None)
set the semantic MediaWiki
Source code in yprinciple/ypgenapp.py
111 112 113 114 115 116 117 118 119 |
|
setGeneratorEnvironmentFromArgs(args)
set my generator environment from the given command line arguments
Source code in yprinciple/ypgenapp.py
121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
setMWContext()
set my context
Source code in yprinciple/ypgenapp.py
135 136 137 138 139 140 141 |
|
show_GenerateGrid()
show the grid for generating code
Source code in yprinciple/ypgenapp.py
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
show_all()
async
show settings and generator grid
Source code in yprinciple/ypgenapp.py
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
|
update_context_link()
update the context link
Source code in yprinciple/ypgenapp.py
290 291 292 293 294 295 296 297 298 299 300 301 302 |
|
update_context_select()
async
react on update of context select
Source code in yprinciple/ypgenapp.py
304 305 306 307 308 309 310 311 312 313 314 315 |
|
YPGenServer
Bases: InputWebserver
Y-Principle Generator webserver
Source code in yprinciple/ypgenapp.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
__init__()
Constructs all the necessary attributes for the WebServer object.
Source code in yprinciple/ypgenapp.py
47 48 49 |
|
configure_run()
Source code in yprinciple/ypgenapp.py
51 52 53 54 55 |
|
get_config()
classmethod
get the configuration for this Webserver
Source code in yprinciple/ypgenapp.py
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|