_CHAR_ATTR_LESS,
_CHAR_ATTR_MORE
}
-_TOK_SORT_BOX = 'box'
-_TOK_SORT_ID = 'id'
+_TOK_BOX = 'box'
+TOK_ID = 'id'
_LDRAW_MODE_FILL_N_STUDS = 'fill_n_studs'
_LDRAW_MODE_FILL_PATHS = 'fill_paths'
) -> dict[str, tuple[str, dict[str, Callable[[Self, str], bool]]]]:
'Available lookup matchers.'
return {
- _TOK_SORT_ID: (
+ TOK_ID: (
'ID of individual item',
{_CHAR_ATTR_EQ: (
lambda item, val: item.id_ == val)}
tuple[Self, ...]]]]:
'Available sorters.'
return {
- _TOK_SORT_ID: (
+ TOK_ID: (
'by individual items\' IDs',
lambda _, pre_sorted:
tuple(sorted(pre_sorted,
) -> dict[str, tuple[str,
Callable[['BricksDb', tuple[Self, ...]],
tuple[Self, ...]]]]:
- return super().sorters() | {_TOK_SORT_BOX: cls._by_box_sorter('color')}
+ return super().sorters() | {_TOK_BOX: cls._by_box_sorter('color')}
def show(
self
key=lambda item: getattr(item, attr_name)))
return 'by ' + _BrickDesignData.usage(attr_name), f_sort
return super().sorters()\
- | {_TOK_SORT_BOX: cls._by_box_sorter('design')}\
+ | {_TOK_BOX: cls._by_box_sorter('design')}\
| {attr_name: attr_sorter(attr_name)
for attr_name in _BrickDesignData.sortables().keys()}
cls
) -> dict[str, tuple[str, Callable[['BricksDb', tuple[Self, ...]],
tuple[Self, ...]]]]:
- return super().sorters() | {_TOK_SORT_BOX: cls._by_box_sorter()}
+ return super().sorters() | {_TOK_BOX: cls._by_box_sorter()}
@classmethod
def from_textfile(
CHAR_SEP_LDRAW_MODES,
LDRAW_MODES,
PARAM_Q_ID,
+ TOK_ID,
)
NAME_ENV_DIRNAME = 'BRICKSPLOM_DIR'
table_name=args.table,
formatter=args.format,
match_by=args.match or tuple(),
- sort_by=args.sort or tuple()
+ sort_by=args.sort or (TOK_ID, )
).rstrip())