From cc788056ea7e4fa0b1680510817446a2bd55a911 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 12 Aug 2022 14:28:18 -0600 Subject: [PATCH] Tidy --- core/scanner_tossers/ftn_bso.js | 20 +++++++++++++++----- docs/_docs/modding/menu-modules.md | 15 +++++++++++++-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/core/scanner_tossers/ftn_bso.js b/core/scanner_tossers/ftn_bso.js index e3d148bc..4fa97414 100644 --- a/core/scanner_tossers/ftn_bso.js +++ b/core/scanner_tossers/ftn_bso.js @@ -1129,7 +1129,10 @@ function FTNMessageScanTossModule() { ], err => { if (err) { - Log.warn({ error: err.message }, 'Error exporting message'); + Log.warn( + { error: err.message }, + `Error exporting message: ${err.message}` + ); } return nextMessageOrUuid(null); } @@ -1699,7 +1702,7 @@ function FTNMessageScanTossModule() { uuid: message.messageUuid, MSGID: msgId, }, - 'Not importing non-unique message' + `Not importing non-unique message "${message.subject}"` ); return next(null); @@ -1726,6 +1729,7 @@ function FTNMessageScanTossModule() { Log.warn(finalStats, 'Import completed with error(s)'); } else { + // :TODO: Output basic stats - total counts - to this message: Log.info(finalStats, 'Import complete'); } @@ -1816,7 +1820,9 @@ function FTNMessageScanTossModule() { path: paths.join(importDir, packetFile), error: err.toString(), }, - 'Failed to import packet file' + `Failed to import packet file "${paths.basename( + packetFile + )}"` ); rejects.push(packetFile); @@ -2360,7 +2366,9 @@ function FTNMessageScanTossModule() { reason: err.reason, tic: ticFileInfo.filePath, }, - 'Failed to import/update TIC' + `Failed to import/update TIC for "${paths.basename( + ticFileInfo.filePath + )}"` ); } else { Log.info( @@ -2369,7 +2377,9 @@ function FTNMessageScanTossModule() { file: ticFileInfo.filePath, area: localInfo.areaTag, }, - 'TIC imported successfully' + `TIC imported "${paths.basename(ticFileInfo.filePath)}" -> ${ + localInfo.areaTag + }` ); } return cb(err); diff --git a/docs/_docs/modding/menu-modules.md b/docs/_docs/modding/menu-modules.md index 87a8583f..1a1328a8 100644 --- a/docs/_docs/modding/menu-modules.md +++ b/docs/_docs/modding/menu-modules.md @@ -120,8 +120,19 @@ Methods indicated above with `()` in their name such as `enter()` are overridabl Many helper methods exist and are available to code inheriting from `MenuModule`. Below are some examples. Poke around at [menu_module.js](../../../core/menu_module.js) to discover more! ### Views & View Controller -* `displayAsset()` -* `prepViewController()` +#### `displayAsset(name | Buffer, options, callback)`: +Display an asset by `name` or by supplying an `Buffer`. +`options` is an optional Object with any of the following properties: +* `clearScreen` (Boolean): Should the screen be cleared first? +* `encoding` (String): Encoding of `Buffer` if used. Defaults to `cp437`. +* `font` (String): SyncTERM style font to use. +* `trailingLF` (Boolean): Should a trailing LF be allowed? +* `startRow` (Number): Row in which to start drawing at + +#### `prepViewController(name, formId, mciMap, callback)`: +Prepares the menu's View Controller for a form of `name` and `formId` using the supplied `mciMap`. `callback` has the following siguature: `(err, viewController, created)` where `created` is `true` if a new View Controller was made. + + * `prepViewControllerWithArt()` * `displayArtAndPrepViewController()` * `setViewText()`