mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 03:27:34 +00:00
- Introduced `DurationDecorators` for full and short duration formatting. - Added `ExtensionDecorators` for formatting extension information. - Created `ResolutionDecorators` for formatting resolution dimensions. - Implemented `SizeDecorators` for full and short size formatting. - Enhanced `TextDecorators` with additional formatting options including blue and grey text, URL formatting, and escaping rich markup. - Developed `TrackDecorators` for formatting video, audio, and subtitle track data. - Refactored `MediaPanelView` to utilize a new `MediaPanelProperties` class for cleaner property management and formatting. - Updated `media_panel_properties.py` to include formatted properties for file info, TMDB data, metadata extraction, media info extraction, and filename extraction. - Bumped version to 0.6.5 in `uv.lock`.
75 lines
2.3 KiB
Python
75 lines
2.3 KiB
Python
"""Formatters package - provides value formatting for display.
|
|
|
|
This package contains various formatter classes that transform raw values
|
|
into display-ready strings with optional styling.
|
|
|
|
All formatters should inherit from the Formatter ABC defined in base.py.
|
|
"""
|
|
|
|
from .base import (
|
|
Formatter,
|
|
DataFormatter,
|
|
TextFormatter as TextFormatterBase,
|
|
MarkupFormatter,
|
|
CompositeFormatter
|
|
)
|
|
from .text_formatter import TextFormatter
|
|
from .duration_formatter import DurationFormatter
|
|
from .size_formatter import SizeFormatter
|
|
from .date_formatter import DateFormatter
|
|
from .extension_formatter import ExtensionFormatter
|
|
from .resolution_formatter import ResolutionFormatter
|
|
from .track_formatter import TrackFormatter
|
|
from .special_info_formatter import SpecialInfoFormatter
|
|
from .formatter import FormatterApplier
|
|
|
|
# Decorator instances
|
|
from .date_decorators import date_decorators, DateDecorators
|
|
from .special_info_decorators import special_info_decorators, SpecialInfoDecorators
|
|
from .text_decorators import text_decorators, TextDecorators
|
|
from .conditional_decorators import conditional_decorators, ConditionalDecorators
|
|
from .size_decorators import size_decorators, SizeDecorators
|
|
from .extension_decorators import extension_decorators, ExtensionDecorators
|
|
from .duration_decorators import duration_decorators, DurationDecorators
|
|
from .resolution_decorators import resolution_decorators, ResolutionDecorators
|
|
from .track_decorators import track_decorators, TrackDecorators
|
|
|
|
__all__ = [
|
|
# Base classes
|
|
'Formatter',
|
|
'DataFormatter',
|
|
'TextFormatterBase',
|
|
'MarkupFormatter',
|
|
'CompositeFormatter',
|
|
|
|
# Concrete formatters
|
|
'TextFormatter',
|
|
'DurationFormatter',
|
|
'SizeFormatter',
|
|
'DateFormatter',
|
|
'ExtensionFormatter',
|
|
'ResolutionFormatter',
|
|
'TrackFormatter',
|
|
'SpecialInfoFormatter',
|
|
'FormatterApplier',
|
|
|
|
# Decorator instances and classes
|
|
'date_decorators',
|
|
'DateDecorators',
|
|
'special_info_decorators',
|
|
'SpecialInfoDecorators',
|
|
'text_decorators',
|
|
'TextDecorators',
|
|
'conditional_decorators',
|
|
'ConditionalDecorators',
|
|
'size_decorators',
|
|
'SizeDecorators',
|
|
'extension_decorators',
|
|
'ExtensionDecorators',
|
|
'duration_decorators',
|
|
'DurationDecorators',
|
|
'resolution_decorators',
|
|
'ResolutionDecorators',
|
|
'track_decorators',
|
|
'TrackDecorators',
|
|
] |