fediverse_pasture_inputs.types
fediverse_pasture_inputs.types
app_to_profile_map = {'misskey': 'firefish'}
module-attribute
Maps app to profile used to generate details and support tables
InputData
dataclass
Dataclass describing an input for an object support table
Parameters:
Name | Type | Description | Default |
---|---|---|---|
title
|
str
|
Title of the support table |
required |
frontmatter
|
str
|
Frontmatter describing why the support table exists |
required |
details_frontmatter
|
str
|
Further explanation on details and support table. |
''
|
examples
|
List[Dict]
|
List of dictionaries being added to the object |
required |
filename
|
str
|
Name of generated markdown file |
required |
support_table
|
bool
|
Show a support table, i.e. one table table for all applications |
False
|
support_title
|
str | None
|
title for the entry corresponding to the activity |
None
|
support_result
|
Dict[str, Callable[Dict, str]]
|
Maps each application to the string to be shown |
dict()
|
detail_table
|
bool
|
Show a detail table, i.e. a table for each applications |
False
|
detail_title
|
Dict[str, str]
|
Maps application to the title line |
dict()
|
detail_extractor
|
Dict[str, Callable[Dict, List[str]]]
|
Maps application to the corresponding fields. The result will be |
dict()
|
Source code in fediverse_pasture_inputs/types.py
value_from_dict_for_app(dictionary, app, default='❌')
Returns the value corresponding to app from dictionary
by performing a lookup in app_to_profile_map and assuming mastodon
is the default
value.
>>> dictionary = {"known": "known",
... "mastodon": "mastodon",
... "firefish": "firefish"}
>>> value_from_dict_for_app(dictionary, "unknown")
'mastodon'
>>> value_from_dict_for_app(dictionary, "known")
'known'
>>> value_from_dict_for_app(dictionary, "misskey")
'firefish'