1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 07:47:14 +03:00

PLUGINS.md: Fix example return type hint for journal_entry()

It's `Optional[str]` for possible error string being returned.
This commit is contained in:
Athanasius 2022-08-15 08:39:34 +01:00
parent 86e148ddb0
commit fa834daaca
No known key found for this signature in database
GPG Key ID: 8C392035DD80FD62

View File

@ -562,7 +562,7 @@ for an example of these techniques.
```python
def journal_entry(
cmdr: str, is_beta: bool, system: str, station: str, entry: Dict[str, Any], state: Dict[str, Any]
) -> None:
) -> Optional[str]:
if entry['event'] == 'FSDJump':
# We arrived at a new system!
if 'StarPos' in entry:
@ -779,7 +779,7 @@ Examples of this are:
### Journal entry in CQC
New in version 5.2.0
```python
def journal_entry_cqc(cmdr: str, is_beta: bool, entry: Dict[str, Any], state: Dict[str, Any]) -> None:
def journal_entry_cqc(cmdr: str, is_beta: bool, entry: Dict[str, Any], state: Dict[str, Any]) -> Optional[str]:
if entry['event'] == 'Location':
# We loaded to CQC match, lets detect map!
cqc_maps = { # dict to map systems names to CQC maps, ref: https://forums.frontier.co.uk/threads/cqc-systems.234394/