From 55aca836fe4313e2d93b6eb0e5702fec2857388b Mon Sep 17 00:00:00 2001 From: Peter van Dijk <peter.van.dijk@powerdns.com> Date: Mon, 5 Apr 2021 18:57:07 +0200 Subject: [PATCH 1/7] make doc builder more portable --- scripts/docs/bin/build_docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs/bin/build_docs.py b/scripts/docs/bin/build_docs.py index ade49d16e..d812bdce1 100755 --- a/scripts/docs/bin/build_docs.py +++ b/scripts/docs/bin/build_docs.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Hammerspoon API Documentation Builder""" From b24a837fe36520af5fe40531679af8fd1d952168 Mon Sep 17 00:00:00 2001 From: Peter van Dijk <peter.van.dijk@powerdns.com> Date: Mon, 5 Apr 2021 19:01:26 +0200 Subject: [PATCH 2/7] fix rendering of hs.dialog.textPrompt examples --- extensions/dialog/internal.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/dialog/internal.m b/extensions/dialog/internal.m index 8e3e6185b..babe019e7 100755 --- a/extensions/dialog/internal.m +++ b/extensions/dialog/internal.m @@ -679,10 +679,10 @@ static int blockAlert(lua_State *L) { /// * `buttonOne` defaults to "OK" if no value is supplied. /// * `buttonOne` will also be triggered by pressing `ENTER`, whereas `buttonTwo` will be triggered by pressing `ESC`. /// * Examples: -/// `hs.dialog.textPrompt("Main message.", "Please enter something:")` -/// `hs.dialog.textPrompt("Main message.", "Please enter something:", "Default Value", "OK")` -/// `hs.dialog.textPrompt("Main message.", "Please enter something:", "Default Value", "OK", "Cancel")` -/// `hs.dialog.textPrompt("Main message.", "Please enter something:", "", "OK", "Cancel", true)` +/// * `hs.dialog.textPrompt("Main message.", "Please enter something:")` +/// * `hs.dialog.textPrompt("Main message.", "Please enter something:", "Default Value", "OK")` +/// * `hs.dialog.textPrompt("Main message.", "Please enter something:", "Default Value", "OK", "Cancel")` +/// * `hs.dialog.textPrompt("Main message.", "Please enter something:", "", "OK", "Cancel", true)` static int textPrompt(lua_State *L) { NSString* defaultButton = @"OK"; From 4272dadab793ad0cf93e23ece44817e2d47ab26e Mon Sep 17 00:00:00 2001 From: Peter van Dijk <peter.van.dijk@powerdns.com> Date: Mon, 5 Apr 2021 19:09:48 +0200 Subject: [PATCH 3/7] hs.dialog.chooseFileOrFolder: fix documented allowedFileTypes default --- extensions/dialog/internal.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/dialog/internal.m b/extensions/dialog/internal.m index babe019e7..bd8fb7ccd 100755 --- a/extensions/dialog/internal.m +++ b/extensions/dialog/internal.m @@ -332,7 +332,7 @@ static int colorPanelHide(lua_State *L) { /// * [canChooseFiles] - Whether or not the user can select files. Defaults to `true`. /// * [canChooseDirectories] - Whether or not the user can select folders. Default to `false`. /// * [allowsMultipleSelection] - Allow multiple selections of files and/or folders. Defaults to `false`. -/// * [allowedFileTypes] - An optional table of allowed file types. Defaults to `true`. +/// * [allowedFileTypes] - An optional table of allowed file types. Defaults to allowing all types. /// * [resolvesAliases] - An optional boolean that indicates whether the panel resolves aliases. /// /// Returns: From 7ecd624ad7cce8f6a54641cd1cba67c7aeff165b Mon Sep 17 00:00:00 2001 From: Peter van Dijk <peter.van.dijk@powerdns.com> Date: Mon, 5 Apr 2021 19:41:17 +0200 Subject: [PATCH 4/7] hs.dialog.chooseFileOrFolder: fix documented return type --- extensions/dialog/internal.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/dialog/internal.m b/extensions/dialog/internal.m index bd8fb7ccd..cf77d05d9 100755 --- a/extensions/dialog/internal.m +++ b/extensions/dialog/internal.m @@ -322,7 +322,7 @@ static int colorPanelHide(lua_State *L) { #pragma mark - Choose File or Folder -/// hs.dialog.chooseFileOrFolder([message], [defaultPath], [canChooseFiles], [canChooseDirectories], [allowsMultipleSelection], [allowedFileTypes], [resolvesAliases]) -> string +/// hs.dialog.chooseFileOrFolder([message], [defaultPath], [canChooseFiles], [canChooseDirectories], [allowsMultipleSelection], [allowedFileTypes], [resolvesAliases]) -> table or nil /// Function /// Displays a file and/or folder selection dialog box using NSOpenPanel. /// From da19e0bf207d397a23ff86945164879ecd11a701 Mon Sep 17 00:00:00 2001 From: Peter van Dijk <peter.van.dijk@powerdns.com> Date: Mon, 5 Apr 2021 20:31:28 +0200 Subject: [PATCH 5/7] improve error from build_docs.py --- scripts/docs/bin/build_docs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/docs/bin/build_docs.py b/scripts/docs/bin/build_docs.py index d812bdce1..24933f900 100755 --- a/scripts/docs/bin/build_docs.py +++ b/scripts/docs/bin/build_docs.py @@ -320,8 +320,8 @@ def is_actual_parameter(some_text): parameter_count = len(actual_params) if parameter_count != sig_arg_count: warn("SIGNATURE/PARAMETER COUNT MISMATCH: '%s' says %d parameters ('%s'), but Parameters section has %d entries:\n%s\n" % (sig_without_return, sig_arg_count, ','.join(sig_param_arr), parameter_count, '\n'.join(actual_params))) - except: - warn("Unable to parse parameters for %s\n%s\n" % (item["signature"], sys.exc_info()[1])) + except Exception as e: + warn("Unable to parse parameters for %s\n%s\n" % (item["signature"], repr(e))) sys.exit(1) return module From 85ca71d75bafdf446c6194411e69b2c26c972b3c Mon Sep 17 00:00:00 2001 From: Peter van Dijk <peter.van.dijk@powerdns.com> Date: Sun, 11 Apr 2021 00:39:32 +0200 Subject: [PATCH 6/7] hs.timer: fix typo --- extensions/timer/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/timer/init.lua b/extensions/timer/init.lua index bd6a1151b..0e9ee6bf3 100644 --- a/extensions/timer/init.lua +++ b/extensions/timer/init.lua @@ -3,7 +3,7 @@ --- Execute functions with various timing rules --- --- **NOTE**: timers use NSTimer internally, which will be paused when computers sleep. ---- Especially, repeating timers won't be triggered at the specificed time when there are sleeps in between. +--- Especially, repeating timers won't be triggered at the specified time when there are sleeps in between. --- The workaround is to prevent system from sleeping, configured in Energy Saver in System Preferences. local module = require("hs.timer.internal") From a312dc8abd595e5f99fa53f1847887b6e1af5808 Mon Sep 17 00:00:00 2001 From: Chris Jones <cmsj@tenshu.net> Date: Sun, 10 Dec 2023 16:43:56 +0000 Subject: [PATCH 7/7] Update build_docs.py --- scripts/docs/bin/build_docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/docs/bin/build_docs.py b/scripts/docs/bin/build_docs.py index 24933f900..fd921b76e 100755 --- a/scripts/docs/bin/build_docs.py +++ b/scripts/docs/bin/build_docs.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/python3 # -*- coding: utf-8 -*- """Hammerspoon API Documentation Builder"""