mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-12-11 15:12:53 +00:00
### Description
Add new class to wrap base config and cli mixin to help with typing:
```python
class CliConfig(BaseConfig, CliMixin):
pass
```
20 lines
583 B
Python
20 lines
583 B
Python
import typing as t
|
|
from abc import ABC
|
|
from dataclasses import dataclass, field
|
|
|
|
from unstructured.ingest.cli.interfaces import CliConfig
|
|
from unstructured.ingest.interfaces import BaseConfig
|
|
|
|
|
|
@dataclass
|
|
class BaseCmd(ABC):
|
|
cmd_name: str
|
|
cli_config: t.Optional[t.Type[BaseConfig]] = None
|
|
additional_cli_options: t.List[t.Type[CliConfig]] = field(default_factory=list)
|
|
addition_configs: t.Dict[str, t.Type[BaseConfig]] = field(default_factory=dict)
|
|
is_fsspec: bool = False
|
|
|
|
@property
|
|
def cmd_name_key(self):
|
|
return self.cmd_name.replace("-", "_")
|