mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-05-05 09:51:04 +03:00
[#579] Allow EDMC to Iterate Known CMDRs
This commit is contained in:
parent
9d6d9d145b
commit
7a5635b3fb
16
EDMC.py
16
EDMC.py
@ -126,6 +126,12 @@ def main() -> None: # noqa: C901, CCR001
|
|||||||
action='store_true'
|
action='store_true'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
parser.add_argument(
|
||||||
|
'--refresh-all',
|
||||||
|
help='Iterate over all known CMDRs to try and refresh access tokens',
|
||||||
|
action='store_true',
|
||||||
|
)
|
||||||
|
|
||||||
parser.add_argument('-a', metavar='FILE', help='write ship loadout to FILE in Companion API json format')
|
parser.add_argument('-a', metavar='FILE', help='write ship loadout to FILE in Companion API json format')
|
||||||
parser.add_argument('-e', metavar='FILE', help='write ship loadout to FILE in E:D Shipyard plain text format')
|
parser.add_argument('-e', metavar='FILE', help='write ship loadout to FILE in E:D Shipyard plain text format')
|
||||||
parser.add_argument('-l', metavar='FILE', help='write ship locations to FILE in CSV format')
|
parser.add_argument('-l', metavar='FILE', help='write ship locations to FILE in CSV format')
|
||||||
@ -184,6 +190,16 @@ def main() -> None: # noqa: C901, CCR001
|
|||||||
logger.info(f'marked {d} for TRACE')
|
logger.info(f'marked {d} for TRACE')
|
||||||
|
|
||||||
log_locale('Initial Locale')
|
log_locale('Initial Locale')
|
||||||
|
if args.refresh_all:
|
||||||
|
logger.info("Refreshing all known CMDRs")
|
||||||
|
cmdrs = config.get_list('cmdrs', default=[])
|
||||||
|
for cmdr in cmdrs:
|
||||||
|
logger.info(f'Attempting to use commander "{cmdr}"')
|
||||||
|
try:
|
||||||
|
companion.session.login(cmdr, monitor.is_beta)
|
||||||
|
logger.debug("Succeeded!")
|
||||||
|
except AttributeError:
|
||||||
|
logger.debug(f"Unable to refresh CMDR {cmdr}.")
|
||||||
|
|
||||||
if args.j:
|
if args.j:
|
||||||
logger.debug('Import and collate from JSON dump')
|
logger.debug('Import and collate from JSON dump')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user