justbytes._config module

Configuration of the justbytes package.

class justbytes._config.BaseConfig(use_prefix=False, use_subscript=False)

Bases: justbases._config.BaseConfig

Configuration for display of bases.

Override defaults of justbases.BaseConfig.

class justbytes._config.Config

Bases: object

The super top-level configuration class for ranges.

STRICT = False
STRING_CONFIG = <justbytes._config.StringConfig object at 0x7f247c7dfa90>
classmethod set_display_config(config)

Set configuration for superficial aspects of display.

Parameters:config (DisplayConfig) – a configuration object
classmethod set_display_impl(impl)

Set display implementation.

Parameters:impl (type) – the display implementation class
classmethod set_value_config(config)

Set the configuration for computing the value of string representation.

:param ValueConfig config: a configuration object

class justbytes._config.DisplayConfig(show_approx_str=True, base_config=BaseConfig(use_prefix=False, use_subscript=False), digits_config=DigitsConfig(separator=~, use_caps=False, use_letters=True), strip_config=StripConfig(strip=False, strip_exact=False, strip_whole=True))

Bases: justbases._config.DisplayConfig

DisplayConfig overrides justbases.DisplayConfig’s defaults.

class justbytes._config.StringConfig(value_config, display_config, display_impl)

Bases: object

Configuration for Range class.

class justbytes._config.ValueConfig(max_places=2, min_value=1, binary_units=True, exact_value=False, unit=None, base=10, rounding_method=_RoundingMethod(Round to nearest, to zero on a tie.))

Bases: object

Configuration for __str__ method.

If max_places is set to None, all non-zero digits after the decimal point will be shown. Otherwise, max_places digits will be shown.

min_value sets the smallest value allowed. If min_value is 10, then single digits on the lhs of the decimal will be avoided if possible. In that case, 9216 KiB is preferred to 9 MiB. However, 1 B has no alternative. If min_value is 1, however, 9 MiB is preferred. If min_value is 0.1, then 0.75 GiB is preferred to 768 MiB, but 0.05 GiB is still displayed as 51.2 MiB.

Previous topic

justbytes._util.generators module

Next topic

justbytes._constants module

This Page