xpuz.pages
¤
BrowserPage
¤
BrowserPage(master: Base)
Bases: CTkFrame, Addons
Provides an interface to view available crosswords, set a preference for the word count, generate a crossword based on the selected parameters, and launch the crossword webapp to complete the generated crossword.
Source code in src/xpuz/pages/browser.py
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 | |
_configure_word_count_prefs
¤
_configure_word_count_prefs(state: str) -> None
Configure all the word_count preference widgets to an either an interactive or disabled state (interactive when selecting a crossword, disabled when a crossword has been loaded).
Source code in src/xpuz/pages/browser.py
524 525 526 527 528 529 530 531 532 | |
_handle_scroll
¤
_handle_scroll(
event: Event, container: CTkScrollableFrame
) -> None
Scroll the center scroll frame only if the viewable width is greater than the scroll region. This prevents weird scroll behaviour in cases where the above condition is inverted.
Source code in src/xpuz/pages/browser.py
464 465 466 467 468 469 470 471 472 473 474 475 | |
_load
¤
_load() -> None
Gather data and use _create_app to initialise the Flask app on a
new thread.
Source code in src/xpuz/pages/browser.py
648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 | |
_on_cword_selection
¤
_on_cword_selection(wrapper: CrosswordWrapper) -> None
Called by an instance of CrosswordBlock, which passes the
data for its given crossword into this method. The method then saves
this data, deselects any previous word count radiobutton selections,
reconfigures the values of the custom word count optionmenu to be
compatible with the newly selected crossword, and reconfigures the
max word count label to show the correct maximum word count.
Source code in src/xpuz/pages/browser.py
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 | |
_on_wc_sel
¤
_on_wc_sel(button_name: str) -> None
Configure custom word count optionmenu based on radiobutton selection.
Source code in src/xpuz/pages/browser.py
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | |
_on_webview_close
¤
_on_webview_close() -> None
Update self.webview_open to false when the user closes the
webview.
Source code in src/xpuz/pages/browser.py
534 535 536 537 538 | |
_open_app_embedded
¤
_open_app_embedded(url: str) -> None
Start a webview with the webview module.
Source code in src/xpuz/pages/browser.py
540 541 542 543 544 545 546 547 548 549 550 551 552 553 | |
_reset_scroll_frame
¤
_reset_scroll_frame() -> None
Set the x position of the center scroll frame to the start.
Source code in src/xpuz/pages/browser.py
414 415 416 | |
_reset_search
¤
_reset_search() -> None
Remove all text from the search box and regenerate the placeholder text.
Source code in src/xpuz/pages/browser.py
406 407 408 409 410 411 412 | |
_rollback_states
¤
_rollback_states() -> None
Set all the widgets back to their default states (seen when opening the crossword browser).
Source code in src/xpuz/pages/browser.py
495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 | |
_search_crossword
¤
_search_crossword(query: str) -> None
Regenerate all the crossword blocks based on a crossword name query.
Source code in src/xpuz/pages/browser.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 | |
_update_segbutton_text_colours
¤
_update_segbutton_text_colours(
view: str, sb: CTkSegmentedButton
) -> None
Configure all segmented button colours in sb to have
a black text colour if unselected, otherwise, set the text colour to
white.
Source code in src/xpuz/pages/browser.py
418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | |
change_browser_view
¤
change_browser_view(callback: Optional = None) -> None
Change the browser view to Flattened or Categorical.
Source code in src/xpuz/pages/browser.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 459 460 461 462 | |
load
¤
load() -> None
Initialise the crossword and web app.
Source code in src/xpuz/pages/browser.py
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 | |
open_app
¤
open_app() -> None
Open the crossword web app at a port read from Base.cfg.
Source code in src/xpuz/pages/browser.py
555 556 557 558 559 560 561 562 563 564 565 566 567 | |
terminate
¤
terminate() -> None
Reconfigure the states of the GUIs buttons and terminate the app.
Source code in src/xpuz/pages/browser.py
569 570 571 572 573 574 575 576 577 578 579 580 581 | |
unbind_
¤
unbind_() -> None
Remove bindings which can be detected on different pages.
Source code in src/xpuz/pages/browser.py
386 387 388 389 | |
EditorPage
¤
EditorPage(master: Base)
Bases: CTkFrame, Addons
Base page for editor.py. Consists of some utility methods required
only by CrosswordPane and WordPane, as well as the title bar and contains
for the aforementioned two classes.
Source code in src/xpuz/pages/editor.py
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 | |
_get_user_category_path
¤
_get_user_category_path() -> PathLike
Find where to access categories from, whether that is in the package or in the system documents.
Source code in src/xpuz/pages/editor.py
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | |
_handle_scroll
¤
_handle_scroll(event: Event) -> None
Scroll one of the two scrollable frames depending on the user's cursor position.
Source code in src/xpuz/pages/editor.py
414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 | |
_reset_forms
¤
Remove all the content from the forms in forms.
Source code in src/xpuz/pages/editor.py
458 459 460 461 462 463 464 465 | |
_set_form_defaults
¤
Set the default of each form in forms to the respective value
in args. Requires len(args) to be equal to len(forms).
Source code in src/xpuz/pages/editor.py
467 468 469 470 471 472 | |
_toggle_forms
¤
Enable or disable all the forms in forms.
Source code in src/xpuz/pages/editor.py
451 452 453 454 455 456 | |
_write_data
¤
Write data to a crossword's info.json or definitions.json.
Source code in src/xpuz/pages/editor.py
474 475 476 477 478 | |
unbind_
¤
unbind_() -> None
Remove bindings which can be detected on different pages.
Source code in src/xpuz/pages/editor.py
391 392 393 394 395 396 | |
HomePage
¤
HomePage(master)
Bases: CTkFrame, Addons
Class that serves as a homescreen for the program, providing global setting configuration, exit functionality and the ability to view the currently available crossword puzzles.
Source code in src/xpuz/pages/home.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
_start_version_checking
¤
_start_version_checking() -> None
Create a new event loop and begin checking for a new version of
xpuz asynchronously.
Source code in src/xpuz/pages/home.py
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
change_appearance
¤
change_appearance(appearance: str) -> None
Ensures the user is not selecting the same appearance, then sets the appearance. Some list indexing is required to make the program compatible with non-english languages.
Source code in src/xpuz/pages/home.py
266 267 268 269 270 271 272 273 274 275 276 277 278 | |
change_crossword_quality
¤
change_crossword_quality(quality: str) -> None
Ensures the user is not selecting the same crossword quality, then
updates the crossword quality in config.ini.
Source code in src/xpuz/pages/home.py
307 308 309 310 311 312 313 314 315 316 317 | |
change_lang
¤
change_lang(lang: str) -> None
Ensures the user is not selecting the same language, then creates a
new locale variable based on the English name of the language
(retrieved from self.localised_lang_db). The method then installs a
new set of translations with gettext and regenerates the content of the
GUI.
Source code in src/xpuz/pages/home.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | |
change_scale
¤
change_scale(scale: str) -> None
Ensures the user is not selecting the same scale, then sets the scale.
Source code in src/xpuz/pages/home.py
280 281 282 283 284 285 286 287 288 | |
check_version
async
¤
check_version() -> None
Coroutine to execute utils._check_version asynchronously.
Source code in src/xpuz/pages/home.py
347 348 349 350 351 352 353 354 | |
unbind_
¤
unbind_() -> None
Remove bindings which can be detected on different pages.
Source code in src/xpuz/pages/home.py
262 263 264 | |