Skip to content

xpuz.constants ¤

Constant values used across the source code, defining values such as paths and colour values for both the GUI and the web application.

Attributes:

Name Type Description
DIR_PATH Path

Path to the toplevel of xpuz.

TEMPLATE_CFG_PATH str

Path to template config.ini file.

DOC_PATH str

Path to the system's documents directory or equivalent.

DOC_DATA_PATH str

Path to the xpuz folder within the system's documents directory.

DOC_CAT_PATH str

Path to the user folder within the xpuz folder.

DOC_CFG_PATH str

Path to the config.ini file within the xpuz folder.

LOCALES_PATH str

Path to the package's locales folder.

BASE_POT_PATH str

Path to the package's translation template file.

ASSETS_PATH str

Path to the package's assets folder.

IMAGES_PATH str

Path to the package's image folder, located within assets.

BASE_CWORDS_PATH str

Path to the package's base crosswords folder.

ATTEMPTS_DB_PATH str

Path to the attempts_db.json file for crossword optimisation.

DIFFICULTIES List[str]

Crossword difficulties.

ACROSS str

Representation of a word going right to left.

DOWN str

Representation of a word going top to bottom.

EMPTY str

Representation of a void cell in the crossword grid.

NONLANGUAGE_PATTERN Pattern

Regex pattern to filter out non-language characters.

QUALITY_MAP Dict[str, float]

Mapping of crossword quality descriptors to a float value, which is used to scale how many optimisation attempts are undergone to make a crossword with that quality.

WHITESPACE_SCALAR float

A value to scale the whitespace present in a crossword grid.

DIMENSIONS_CONSTANT int

A value that is added to the final grid dimension calculation after applying math.ceil.

PDF_WIDTH int

PDF A4 width.

PDF_HEIGHT int

PDF A4 height.

PDF_MARGIN int

PDF A4 margin.

FONTSIZE_DIR_TITLE int

Font size of the title for the 'Across' or 'Down' columns in a PDF.

FONTSIZE_DEF int

Clue font size.

PAGE_DEF_MAX int

How many clues can fit on a page.

DIM Tuple[int, int]

Standard tkinter GUI dimensions

EDITOR_DIM Tuple[int, int]

Dimensions for the crossword editor within the tkinter GUI.

LANG_REPLACEMENTS Dict[str, Union[str, None]]

Mapping of google translate language codes to their respective Babel language codes. None if they do not exist, otherwise, a string representing the Babel-correct code.

Colour ¤

Hex colour specification for both the GUI and the web app.

Dark ¤

Dark mode hex colours.

Global ¤

Global hex colours.

Light ¤

Light mode hex colours.