diff --git a/.gitignore b/.gitignore
index cfbb1c8..fcadbe0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,6 +28,10 @@ build-common/bleak_winrt
pf2
pf2.zip
*.pf2
+# archlinux package build files
+cat-printer-git
+pkg
+*.pkg.tar.zst
# dev config
config.json
# dev backup
diff --git a/PKGBUILD b/PKGBUILD
index e60e8f1..af5f8e7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,13 +1,14 @@
# Maintainer :
pkgname=cat-printer-git
-pkgver=r30.eafaa6e
+pkgver=r153.85cb5a8
pkgrel=1
pkgdesc="A project that provides support to some Bluetooth Cat Printer models, on many platforms!"
arch=('any')
url="https://github.com/NaitLee/Cat-Printer"
license=('GPL3')
-depends=('python' 'bluez' 'bluez-utils' 'python-bleak' 'ghostscript' 'imagemagick')
+depends=('python' 'bluez' 'python-bleak')
+optdepends=('bluez-utils' 'ghostscript' 'imagemagick')
makedepends=('git' 'unzip')
provides=("cat-printer=${pkgver}")
source=("$pkgname::git+https://github.com/NaitLee/Cat-Printer.git")
diff --git a/printer.py b/printer.py
index 5d35a52..c2839d7 100644
--- a/printer.py
+++ b/printer.py
@@ -23,6 +23,7 @@ class ExitCodes():
PrinterError = 64
IncompleteProgram = 128
MissingDependency = 129
+ UserInterrupt = 254
def info(*args, **kwargs):
'Just `print` to `stdout`'
@@ -345,7 +346,7 @@ def connect(self, name=None, address=None):
self.device = None
if name is None and address is None:
return
- self.model = Models[name]
+ self.model = Models.get(name, Models['_ZZ00'])
self.device = BleakClient(address)
def notify(_char, data):
if data == self.data_flow_pause:
@@ -595,10 +596,10 @@ def fallback_program(*programs):
def magick_text(stdin, image_width, font_size, font_family):
'Pipe an io to ImageMagick for processing text to image, return output io'
- read_fd, write_fd = os.pipe()
if _MagickExe is None:
- fatal(i18n("imagemagick-not-found"), code=129)
-
+ fatal(i18n("imagemagick-not-found"), code=ExitCodes.MissingDependency)
+
+ read_fd, write_fd = os.pipe()
subprocess.Popen([_MagickExe, '-background', 'white', '-fill', 'black',
'-size', f'{image_width}x', '-font', font_family, '-pointsize',
str(font_size), 'caption:@-', 'pbm:-'],
@@ -607,10 +608,10 @@ def magick_text(stdin, image_width, font_size, font_family):
def magick_image(stdin, image_width, dither):
'Pipe an io to ImageMagick for processing "usual" image to pbm, return output io'
- read_fd, write_fd = os.pipe()
if _MagickExe is None:
- fatal(i18n("imagemagick-not-found"), code=129)
+ fatal(i18n("imagemagick-not-found"), code=ExitCodes.MissingDependency)
+ read_fd, write_fd = os.pipe()
subprocess.Popen([_MagickExe, '-', '-fill', 'white', '-opaque', 'transparent',
'-resize', f'{image_width}x', '-dither', dither, '-monochrome', 'pbm:-'],
stdin=stdin, stdout=io.FileIO(write_fd, 'w'))
@@ -677,6 +678,10 @@ def _main():
help=i18n('print-quality'))
parser.add_argument('-d', '--dry', action='store_true',
help=i18n('dry-run-test-print-process-only'))
+ parser.add_argument('-u', '--unknown', action='store_true',
+ help=i18n('try-to-print-through-an-unknown-device'))
+ parser.add_argument('-0', '--0th', action='store_true',
+ help=i18n('no-prompt-for-multiple-devices'))
parser.add_argument('-f', '--fake', metavar='XY01', type=str, default='',
help=i18n('virtual-run-on-specified-model'))
parser.add_argument('-m', '--dump', action='store_true',
@@ -729,18 +734,6 @@ def _main():
mode = 'pbm'
- # Connect to printer
- if args.dry:
- info(i18n('dry-run-test-print-process-only'))
- printer.dry_run = True
- if args.fake:
- printer.fake = True
- printer.model = Models[args.fake]
- else:
- info(i18n('connecting'))
- printer.scan(identifier, use_result=True)
- printer.dump = args.dump
-
# Prepare image / text
if args.text:
info(i18n('text-printing-mode'))
@@ -758,15 +751,46 @@ def _main():
else 'FloydSteinberg')
)
+ # Connect to printer
+ if args.dry:
+ info(i18n('dry-run-test-print-process-only'))
+ printer.dry_run = True
+ if args.fake:
+ printer.fake = True
+ printer.model = Models[args.fake]
+ else:
+ info(i18n('scanning-for-devices'))
+ devices = printer.scan(identifier, everything=args.unknown)
+
+ printer.dump = args.dump
+
if args.nothing:
global Printer
Printer = printer
return
+ if len(devices) == 0:
+ error(i18n('no-available-devices-found'), error=PrinterError)
+ if len(devices) == 1 or getattr(args, '0th'):
+ info(i18n('connecting'))
+ printer.connect(devices[0].name, devices[0].address)
+ else:
+ info(i18n('there-are-multiple-devices-'))
+ for i in range(len(devices)):
+ d = devices[i]
+ n = str(d.name) + "-" + d.address[3:5] + d.address[0:2]
+ info('%4i\t%s' % (i, n))
+ choice = 0
+ try:
+ choice = int(input(i18n('choose-which-one-0-', choice)))
+ except KeyboardInterrupt:
+ raise
+ except:
+ pass
+ info(i18n('connecting'))
+ printer.connect(devices[choice].name, devices[choice].address)
try:
printer.print(file, mode=mode)
info(i18n('finished'))
- except KeyboardInterrupt:
- info(i18n('stopping'))
finally:
file.close()
printer.unload()
@@ -778,8 +802,9 @@ def main():
except BleakError as e:
error_message = str(e)
if (
- ('not turned on' in error_message) or # windows or android
- (isinstance(e, BleakDBusError) and # linux/dbus/bluetoothctl
+ 'not turned on' in error_message or
+ 'No powered Bluetooth adapter' in error_message or
+ (isinstance(e, BleakDBusError) and
getattr(e, 'dbus_error') == 'org.bluez.Error.NotReady')
):
fatal(i18n('please-enable-bluetooth'), code=ExitCodes.GeneralError)
@@ -789,9 +814,11 @@ def main():
fatal(e.message_localized, code=ExitCodes.PrinterError)
except RuntimeError as e:
if 'no running event loop' in str(e):
- pass # non-sense
+ pass # ignore this
else:
raise
+ except KeyboardInterrupt:
+ fatal(i18n('stopping'), code=ExitCodes.UserInterrupt)
if __name__ == '__main__':
main()
diff --git a/printer_lib/models.py b/printer_lib/models.py
index a181a7f..989ad62 100644
--- a/printer_lib/models.py
+++ b/printer_lib/models.py
@@ -19,7 +19,7 @@ class Model():
Models = {}
# all known supported models
-for name in 'GB01 GB02 GB03 GT01 MX05 MX06 YT01'.split(' '):
+for name in '_ZZ00 GB01 GB02 GB03 GT01 MX05 MX06 MX08 YT01'.split(' '):
Models[name] = Model()
# that can receive compressed data
@@ -27,5 +27,5 @@ class Model():
Models[name].is_new_kind = True
# that have problem giving feed command
-for name in 'MX05 MX06'.split(' '):
+for name in 'MX05 MX06 MX08'.split(' '):
Models[name].problem_feeding = True
diff --git a/server.py b/server.py
index d7ea124..fa2d06c 100644
--- a/server.py
+++ b/server.py
@@ -74,13 +74,13 @@ class PrinterServerHandler(BaseHTTPRequestHandler):
settings = DictAsObject({
'config_path': 'config.json',
- 'version': 3,
+ 'version': 4,
'first_run': True,
'is_android': False,
'scan_time': 4.0,
'dry_run': False,
'energy': 64,
- 'quality': 32
+ 'quality': 36
})
_settings_blacklist = (
'printer', 'is_android'
diff --git a/www/about.html b/www/about.html
index 81b6f87..b5e8e70 100644
--- a/www/about.html
+++ b/www/about.html
@@ -45,6 +45,12 @@
Contributors
Collaborator
Translator
+
+
+ nodlek-ctrl
+
+ Minor Tweaks
+
All testers & users
Everyone is awesome!
@@ -52,7 +58,7 @@ Contributors
Copyright
- Copyright © 2021-2022 NaitLee Soft.
+ Copyright © 2021-2023 NaitLee Soft.
Some rights reserved.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
diff --git a/www/index.html b/www/index.html
index e80736f..86cfcf5 100644
--- a/www/index.html
+++ b/www/index.html
@@ -43,17 +43,17 @@ Cat Printer
Brightness:
-
+
Strength:
-
+
Quality:
-
+
diff --git a/www/lang/de-DE.json b/www/lang/de-DE.json
index 08f7eb0..0b1816e 100644
--- a/www/lang/de-DE.json
+++ b/www/lang/de-DE.json
@@ -142,5 +142,11 @@
"test-unknown-device": "Unbekanntes Gerät testen",
"now-will-scan-for-all-bluetooth-devices-nearby": "Der Scan sucht jetzt nach allen Bluetooth-Geräten in der Nähe",
- "pf2-font-not-found-or-broken-0": "PF2 font not found or broken: '{0}'"
+ "pf2-font-not-found-or-broken-0": "PF2 font not found or broken: '{0}'",
+ "try-to-print-through-an-unknown-device": "Try to print through an unknown device",
+ "scanning-for-all-bluetooth-devices-nearby": "Scanning for all bluetooth devices nearby…",
+ "there-are-multiple-devices-": "There are multiple devices:",
+ "choose-which-one-0-": "Choose which one? [{0}]: ",
+ "multiple-devices-found-please-specify-one": "Multiple devices found, please specify one",
+ "no-prompt-for-multiple-devices": "No prompt for multiple devices"
}
\ No newline at end of file
diff --git a/www/lang/en-US.json b/www/lang/en-US.json
index 6da2fba..38b02bf 100644
--- a/www/lang/en-US.json
+++ b/www/lang/en-US.json
@@ -158,8 +158,12 @@
"rotate-image": "Rotate Image",
"test-unknown-device": "Test Unknown Device",
"scan": "Scan",
- "now-will-scan-for-all-bluetooth-devices-nearby": "Scan set to search for all bluetooth devides nearby.",
"pf2-font-not-found-or-broken-0": "PF2 font not found or broken: '{0}'",
- "imagemagick-not-found": "ImageMagick not found, please install it and retry."
-
+ "imagemagick-not-found": "ImageMagick not found, please install it and retry.",
+ "try-to-print-through-an-unknown-device": "Try to print through an unknown device",
+ "scanning-for-all-bluetooth-devices-nearby": "Scanning for all bluetooth devices nearby…",
+ "there-are-multiple-devices-": "There are multiple devices:",
+ "choose-which-one-0-": "Choose which one? [{0}]: ",
+ "multiple-devices-found-please-specify-one": "Multiple devices found, please specify one",
+ "no-prompt-for-multiple-devices": "No prompt for multiple devices"
}
\ No newline at end of file
diff --git a/www/lang/lolcat.json b/www/lang/lolcat.json
index f898bf2..7f95fc6 100644
--- a/www/lang/lolcat.json
+++ b/www/lang/lolcat.json
@@ -18,16 +18,16 @@
"misc": "OTHR",
"system": "SYS",
"disable-animation": "NO MOTION",
- "exit": "BAK TO HOM",
+ "exit": "BAK 2 HOM",
"error-message": "SOMTHIN WRONG",
"preview": "LOOK",
"print": "PAW STEP",
"expand": "MORE",
"crop": "LESS",
- "scanning-for-devices": "LUKIN FOR KITTEZ",
- "scan-time-": "HOW LONG TO FIND",
+ "scanning-for-devices": "LUKIN 4 KITTEZ",
+ "scan-time-": "HOW LONG 2 FIND",
"-seconds": "SECS",
- "no-available-devices-found": "NO KITTE FOUND",
+ "no-available-devices-found": "NO KITTE FINDZ",
"found-0-available-devices": {
"single": "THER IS {0} KITTE",
"multiple": "THER R {0} KITTEZ"
@@ -42,10 +42,10 @@
"please-enable-bluetooth": "OPEN YA BLUETOOTH PLZ",
"error-happened-please-check-error-message": "SOMTHIN WRONG CHK ERR LOG PLZ",
"you-can-seek-for-help-with-detailed-info-below": "ASK OTHR KITTE WITH THEZ",
- "or-try-to-scan-longer": "TRY TO FIND BIT LONGER",
- "print-to-cat-printer": "PAWS TO STEP ON PAPR OF KITTE PRINTER!",
+ "or-try-to-scan-longer": "TRY 2 FIND BIT LONGER",
+ "print-to-cat-printer": "PAWS 4 KITTEZ 2 STEP!!",
"supported-models-": "KNOWN KITTEZ>",
- "path-to-input-file-dash-for-stdin": "WHAT FILE TO STEP '-' MEAN STDIN",
+ "path-to-input-file-dash-for-stdin": "WHAT FILE 2 STEP '-' MEAN STDIN",
"please-install-pyobjc-via-pip": "INSTAL `pyobjc` VIA pip",
"please-install-bleak-via-pip": "INSTAL `bleak` VIA pip",
"folder-printer_lib-is-incomplete-or-missing-please-check": "DIR `printer_lib` HAV PROBLM CHK PLZ",
@@ -69,7 +69,7 @@
"dump-traffic": "WACH KITTE PAWS",
"right-to-left-text-order": "YA READ RTL",
"auto-wrap-line": "WRAP MEOW",
- "process-as-": "HOW TO STEP>",
+ "process-as-": "HOW 2 STEP>",
"text": "MEOW",
"picture": "PICS",
"pattern": "SPOTS",
@@ -104,14 +104,14 @@
"COMMA": "COMA",
"DOT": "DOT",
"to-enter-keyboard-mode-press-tab": "KEYBORD G33KS PRES TAB",
- "usage-": "HOW TO USE>",
+ "usage-": "HOW 2 USE>",
"positional-arguments-": "ARGS>",
"options-": "OPTS>",
"show-this-help-message": "SHOW WHAT YA LOOKIN NOW",
"do-nothing": "SLEEPY KITTE",
"scan-for-a-printer": "FIND A KITTE",
"text-printing-mode-with-options": "NO STEP PIC WANT MEOW",
- "image-printing-options": "HOW TO STEP A PIC",
+ "image-printing-options": "HOW 2 STEP A PIC",
"convert-input-image-with-imagemagick": "HLP WITH ImageMagick",
"reset-configuration-": "RLY SCREW CFG?",
"brightness-": "BLAK OR WHITE>",
@@ -138,6 +138,11 @@
"now-will-scan-for-all-bluetooth-devices-nearby": "WIL FIND ALL THINY KITTE OR NOT",
"scan": "FIND",
"pf2-font-not-found-or-broken-0": "KITTE FONT LOST OR DEAD> {0}",
- "image-magick-not-found": "IMAGEMAGICK NOT FINDZ, PLZ INSTALL IT AND HAVES ANODA GO."
-
+ "image-magick-not-found": "IMAGEMAGICK NOT FINDZ, PLZ INSTALL IT AND HAVES ANODA GO.",
+ "try-to-print-through-an-unknown-device": "STEP WIZ STRENGE KITTE",
+ "scanning-for-all-bluetooth-devices-nearby": "LOOKIN 4 KITTEZ…",
+ "there-are-multiple-devices-": "MANY KITTEZ!!",
+ "choose-which-one-0-": "ADOPT A KITTE PLZ [{0}]: ",
+ "multiple-devices-found-please-specify-one": "MANY KITTEZ!! ADOPT ONE PLZ",
+ "no-prompt-for-multiple-devices": "ADOPT KITTE ONCE FINDZ ONE"
}
diff --git a/www/lang/zh-CN.json b/www/lang/zh-CN.json
index 629b585..264cbcf 100644
--- a/www/lang/zh-CN.json
+++ b/www/lang/zh-CN.json
@@ -150,5 +150,11 @@
"free-software": "自由软件",
"free-software-description": "尊重您计算自由的软件。",
"pf2-font-not-found-or-broken-0": "PF2 字体丢失或损坏:'{0}'",
- "image-magick-not-found": "未找到 ImageMagick,请安装并重试。"
+ "imagemagick-not-found": "未找到 ImageMagick,请安装并重试。",
+ "try-to-print-through-an-unknown-device": "试着用未知的设备打印",
+ "scanning-for-all-bluetooth-devices-nearby": "正在搜索附近所有蓝牙设备……",
+ "there-are-multiple-devices-": "有多个设备:",
+ "choose-which-one-0-": "选择哪一个?[{0}]:",
+ "multiple-devices-found-please-specify-one": "找到多个设备,请指定",
+ "no-prompt-for-multiple-devices": "发现多个设备时不提示选择"
}
\ No newline at end of file
diff --git a/www/lang/zh-HK.json b/www/lang/zh-HK.json
index d793ed6..09c869b 100644
--- a/www/lang/zh-HK.json
+++ b/www/lang/zh-HK.json
@@ -150,5 +150,11 @@
"free-software": "自由軟件",
"free-software-description": "尊重您計算自由的軟件。",
"pf2-font-not-found-or-broken-0": "PF2 字體丟失或損壞:'{0}'",
- "imagemagick-not-found": "未找到 ImageMagick,請安裝並重試。"
+ "imagemagick-not-found": "未找到 ImageMagick,請安裝並重試。",
+ "try-to-print-through-an-unknown-device": "試着用未知的設備打印",
+ "scanning-for-all-bluetooth-devices-nearby": "正在搜索附近所有藍牙設備……",
+ "there-are-multiple-devices-": "有多個設備:",
+ "choose-which-one-0-": "選擇哪一個?[{0}]:",
+ "multiple-devices-found-please-specify-one": "找到多個設備,請指定",
+ "no-prompt-for-multiple-devices": "發現多個設備時不提示選擇"
}
\ No newline at end of file
diff --git a/www/lang/zh-Hant-CN.json b/www/lang/zh-Hant-CN.json
index 1afb3a3..8e21bc3 100644
--- a/www/lang/zh-Hant-CN.json
+++ b/www/lang/zh-Hant-CN.json
@@ -150,5 +150,11 @@
"free-software": "自由軟件",
"free-software-description": "尊重您計算自由的軟件。",
"pf2-font-not-found-or-broken-0": "PF2 字體丟失或損壞:'{0}'",
- "imagemagick-not-found": "未找到 ImageMagick,請安裝並重試。"
+ "imagemagick-not-found": "未找到 ImageMagick,請安裝並重試。",
+ "try-to-print-through-an-unknown-device": "試着用未知的設備打印",
+ "scanning-for-all-bluetooth-devices-nearby": "正在搜索附近所有藍牙設備……",
+ "there-are-multiple-devices-": "有多個設備:",
+ "choose-which-one-0-": "選擇哪一個?[{0}]:",
+ "multiple-devices-found-please-specify-one": "找到多個設備,請指定",
+ "no-prompt-for-multiple-devices": "發現多個設備時不提示選擇"
}
\ No newline at end of file
diff --git a/www/lang/zh-TW.json b/www/lang/zh-TW.json
index 2081b97..a560ffe 100644
--- a/www/lang/zh-TW.json
+++ b/www/lang/zh-TW.json
@@ -149,5 +149,12 @@
"javascript-catprinter-description": "貓咪印表機 (Cat-Printer) 主指令碼",
"free-software": "自由軟體",
"free-software-description": "尊重您計算自由的軟體。",
- "pf2-font-not-found-or-broken-0": "未找到 ImageMagick,請安裝並重試。"
+ "pf2-font-not-found-or-broken-0": "PF2 字型丟失或損壞:'{0}'",
+ "imagemagick-not-found": "未找到 ImageMagick,請安裝並重試。",
+ "try-to-print-through-an-unknown-device": "試著用未知的裝置列印",
+ "scanning-for-all-bluetooth-devices-nearby": "正在搜尋附近所有藍芽裝置……",
+ "there-are-multiple-devices-": "有多個裝置:",
+ "choose-which-one-0-": "選擇哪一個?[{0}]:",
+ "multiple-devices-found-please-specify-one": "找到多個裝置,請指定",
+ "no-prompt-for-multiple-devices": "發現多個裝置時不提示選擇"
}
\ No newline at end of file
diff --git a/www/main.js b/www/main.js
index f42aec7..372e971 100644
--- a/www/main.js
+++ b/www/main.js
@@ -191,16 +191,14 @@ async function callApi(path, body, errorPreHandler) {
}).then(async (response) => {
if (response.ok) return response.json()
else {
+ const response_clone = response.clone();
try {
- // forgive this dirty trick
- let json = response.json();
- response.json = () => json;
- if (errorPreHandler) return await errorPreHandler(response);
+ if (errorPreHandler) return await errorPreHandler(response_clone);
else throw new Error('API Failure');
} catch (error) {
ErrorHandler.report(
error,
- JSON.stringify(await response.json(), undefined, 4)
+ JSON.stringify(await response_clone.json(), undefined, 4)
)
return Promise.reject('API Failure');
}
@@ -417,7 +415,7 @@ class CanvasController {
this.algorithm = name;
// Ev.dispatch('[name="algo"]', 'change', { value: name });
Ev.dispatch('[name="threshold"]', 'change', { value: CanvasController.defaultThreshold });
- Ev.dispatch('[name="energy"]', 'change', { value: (name == 'algo-direct' ? 96 : 64) });
+ Ev.dispatch('[name="energy"]', 'change', { value: (name == 'algo-direct' ? 96 : 68) });
this.activatePreview();
}
expand(length = CanvasController.defaultHeight) {
@@ -723,12 +721,16 @@ class Main {
* use this flag to avoid
*/
allowSet;
+ devices;
+ connected;
constructor() {
this.allowSet = false;
this.testUnknownDevice = false;
this.deviceOptions = document.getElementById('device-options');
this.settings = {};
this.selectorMap = {};
+ this.devices = [];
+ this.connected = false;
// window.addEventListener('unload', () => this.exit());
/** @type {HTMLIFrameElement} */
let iframe = document.getElementById('frame');
@@ -755,15 +757,16 @@ class Main {
Ev.put('#set-accessibility' , 'click', () => Dialog.alert('#accessibility'));
Ev.put('a[target="frame"]', 'click', () => Dialog.alert('#frame'));
Ev.put('#test-unknown-device' , 'click', () => {
- Dialog.alert(i18n('now-will-scan-for-all-bluetooth-devices-nearby'), null, true);
this.testUnknownDevice = true;
Panel('panel-print');
Hider.show('print');
this.searchDevices();
+ Notice.wait(i18n('scanning-for-all-bluetooth-devices-nearby'));
});
this.conf('#device-options', 'change', 'printer',
- (value) => callApi('/connect', { device: value })
+ (value) =>
+ callApi('/connect', { device: value }).then(() => this.connected = true)
);
this.conf('[name="algo"]' , 'change', 'mono_algorithm',
(value) => this.settings['text_mode'] = (value === 'algo-direct')
@@ -938,31 +941,47 @@ class Main {
}
async searchDevices() {
Notice.wait('scanning-for-devices');
- let search_result = await callApi('/devices', {
+ const search_result = await callApi('/devices', {
everything: this.testUnknownDevice
}, this.handleBluetoothProblem);
- if (search_result === null) return false;
- let devices = search_result.devices;
- for (let e of this.deviceOptions.children) e.remove();
+ this.devices = [];
+ this.connected = false;
+ if (search_result === null) return 0;
+ const devices = this.devices = search_result.devices;
+ // for (const e of this.deviceOptions.children) e.remove();
+ this.deviceOptions.innerHTML = '';
if (devices.length === 0) {
Notice.note('no-available-devices-found');
hint('#device-refresh');
- return false;
+ return 0;
}
Notice.note('found-0-available-devices', [devices.length]);
hint('#insert-picture');
- for (let device of devices) {
- let option = document.createElement('option');
+ for (const device of devices) {
+ const option = document.createElement('option');
option.value = `${device.name},${device.address}`;
option.innerText = `${device.name}-${device.address.slice(3, 5)}${device.address.slice(0, 2)}`;
this.deviceOptions.appendChild(option);
}
Ev.dispatch('#device-options', 'change');
- return true;
+ return devices.length;
}
async print() {
if (this.canvasController.imageUrl === null) return;
await this.set(this.settings);
+ if (!this.connected) {
+ const count = await this.searchDevices();
+ if (count === 0) {
+ Notice.warn('no-available-devices-found');
+ return;
+ } else if (count === 1)
+ void 0;
+ else {
+ Notice.note('multiple-devices-found-please-specify-one')
+ Hider.show('print');
+ return;
+ }
+ }
Notice.wait('printing');
await fetch('/print', {
method: 'POST',