roboherd.herd
¶
RoboHerd
dataclass
¶
RoboHerd(name: str = ‘RoboHerd’, base_url: str = ‘http://abel’, manager: roboherd.herd.manager.HerdManager =
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
|
'RoboHerd'
|
base_url
|
str
|
|
'http://abel'
|
manager
|
HerdManager
|
HerdManager(prefix: str = ‘bot:’, herd_config: roboherd.herd.manager.config.HerdConfig = |
<dynamic>
|
cows
|
List[RoboCow]
|
Built-in mutable sequence. If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified. |
<dynamic>
|
Source code in roboherd/herd/__init__.py
cron_entries()
¶
Returns the cron entries of all cows
builder
¶
create_actor_message_for_cow(cow, base_url)
¶
>>> create_actor_message_for_cow(moocow, "http://domain.example/")
{'baseUrl': 'http://domain.example/',
'preferredUsername': 'moocow',
'automaticallyAcceptFollowers': True,
'profile': {'type': 'Service'}}
Source code in roboherd/herd/builder.py
manager
¶
HerdManager
dataclass
¶
HerdManager(prefix: str = ‘bot:’, herd_config: roboherd.herd.manager.config.HerdConfig =
Parameters:
Name | Type | Description | Default |
---|---|---|---|
prefix
|
str
|
|
'bot:'
|
herd_config
|
HerdConfig
|
HerdConfig(cows: list[roboherd.herd.manager.config.CowConfig] = |
<dynamic>
|
Source code in roboherd/herd/manager/__init__.py
config
¶
ConfigOverrides
¶
Bases: BaseModel
Values used in roboherd.toml
to overide the default
values in the imported cow. This class is meant as a
reference, and not meant to be directly used.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str | None
|
set to override the name |
None
|
handle
|
str | None
|
set to override the handle |
None
|
base_url
|
str | None
|
set to override the base url |
None
|
skip_profile_update
|
bool | None
|
set to skip updating the profile |
None
|
Source code in roboherd/herd/manager/config.py
CowConfig
dataclass
¶
CowConfig(name: str, module: str, attribute: str, config: dict)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
Name of the cow, must be unique |
required |
module
|
str
|
|
required |
attribute
|
str
|
|
required |
config
|
dict
|
|
required |
Source code in roboherd/herd/manager/config.py
HerdConfig
dataclass
¶
HerdConfig(cows: list[roboherd.herd.manager.config.CowConfig] =
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cows
|
list[CowConfig]
|
Built-in mutable sequence. If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified. |
<dynamic>
|
Source code in roboherd/herd/manager/config.py
processor
¶
HerdProcessor
dataclass
¶
HerdProcessor(connection: almabtrieb.Almabtrieb, incoming_handlers: List[roboherd.cow.RoboCow])
Parameters:
Name | Type | Description | Default |
---|---|---|---|
connection
|
Almabtrieb
|
|
required |
incoming_handlers
|
List[RoboCow]
|
|
required |
Source code in roboherd/herd/processor.py
scheduler
¶
HerdScheduler
dataclass
¶
HerdScheduler(entries: List[Tuple[roboherd.cow.RoboCow, roboherd.cow.CronEntry]], connection: almabtrieb.Almabtrieb, scheduler: apscheduler.schedulers.asyncio.AsyncIOScheduler | None = None, task: _asyncio.Task | None = None)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
entries
|
List[Tuple[RoboCow, CronEntry]]
|
|
required |
connection
|
Almabtrieb
|
|
required |
scheduler
|
AsyncIOScheduler | None
|
|
None
|
task
|
Task | None
|
|
None
|