mirror of
https://github.com/boltgolt/howdy.git
synced 2024-09-12 09:41:18 +02:00
Use new config variable names in all scripts
Changed: capture_failed -> save_failed capture_successful -> save_successful ignore_ssh -> abort_if_ssh ignore_closed_lid -> abort_if_lid_closed
This commit is contained in:
parent
58a5368448
commit
0803465cd9
4 changed files with 12 additions and 8 deletions
|
@ -88,6 +88,10 @@ if "upgrade" in sys.argv:
|
|||
key = "abort_if_ssh"
|
||||
if key == "ignore_closed_lid":
|
||||
key = "abort_if_lid_closed"
|
||||
if key == "capture_failed":
|
||||
key = "save_failed"
|
||||
if key == "capture_successful":
|
||||
key = "save_successful"
|
||||
|
||||
try:
|
||||
newConf.set(section, key, value)
|
||||
|
|
|
@ -146,8 +146,8 @@ timeout = config.getint("video", "timeout", fallback=5)
|
|||
dark_threshold = config.getfloat("video", "dark_threshold", fallback=50.0)
|
||||
video_certainty = config.getfloat("video", "certainty", fallback=3.5) / 10
|
||||
end_report = config.getboolean("debug", "end_report", fallback=False)
|
||||
capture_failed = config.getboolean("snapshots", "capture_failed", fallback=False)
|
||||
capture_successful = config.getboolean("snapshots", "capture_successful", fallback=False)
|
||||
save_failed = config.getboolean("snapshots", "save_failed", fallback=False)
|
||||
save_successful = config.getboolean("snapshots", "save_successful", fallback=False)
|
||||
gtk_stdout = config.getboolean("debug", "gtk_stdout", fallback=False)
|
||||
rotate = config.getint("video", "rotate", fallback=0)
|
||||
|
||||
|
@ -232,7 +232,7 @@ while True:
|
|||
# Stop if we've exceded the time limit
|
||||
if time.time() - timings["fr"] > timeout:
|
||||
# Create a timeout snapshot if enabled
|
||||
if capture_failed:
|
||||
if save_failed:
|
||||
make_snapshot(_("FAILED"))
|
||||
|
||||
if dark_tries == valid_frames:
|
||||
|
@ -247,7 +247,7 @@ while True:
|
|||
gsframe = clahe.apply(gsframe)
|
||||
|
||||
# If snapshots have been turned on
|
||||
if capture_failed or capture_successful:
|
||||
if save_failed or save_successful:
|
||||
# Start capturing frames for the snapshot
|
||||
if len(snapframes) < 3:
|
||||
snapframes.append(frame)
|
||||
|
@ -354,7 +354,7 @@ while True:
|
|||
print(_("Winning model: %d (\"%s\")") % (match_index, models[match_index]["label"]))
|
||||
|
||||
# Make snapshot if enabled
|
||||
if capture_successful:
|
||||
if save_successful:
|
||||
make_snapshot(_("SUCCESSFUL"))
|
||||
|
||||
# Run rubberstamps if enabled
|
||||
|
|
|
@ -40,7 +40,7 @@ def doAuth(pamh):
|
|||
if config.getboolean("video", "warn_no_device"):
|
||||
pamh.conversation(pamh.Message(pamh.PAM_ERROR_MSG, "Camera path is not configured correctly, please edit the 'device_path' config value."))
|
||||
return pamh.PAM_AUTHINFO_UNAVAIL
|
||||
|
||||
|
||||
# Set up syslog
|
||||
syslog.openlog("[HOWDY]", 0, syslog.LOG_AUTH)
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ auto check_enabled(const INIReader &config) -> int {
|
|||
}
|
||||
|
||||
// Stop if we're in a remote shell and configured to exit
|
||||
if (config.GetBoolean("core", "ignore_ssh", true)) {
|
||||
if (config.GetBoolean("core", "abort_if_ssh", true)) {
|
||||
if (getenv("SSH_CONNECTION") != nullptr ||
|
||||
getenv("SSH_CLIENT") != nullptr || getenv("SSHD_OPTS") != nullptr) {
|
||||
syslog(LOG_INFO, "Skipped authentication, SSH session detected");
|
||||
|
@ -150,7 +150,7 @@ auto check_enabled(const INIReader &config) -> int {
|
|||
}
|
||||
|
||||
// Try to detect the laptop lid state and stop if it's closed
|
||||
if (config.GetBoolean("core", "ignore_closed_lid", true)) {
|
||||
if (config.GetBoolean("core", "abort_if_lid_closed", true)) {
|
||||
glob_t glob_result;
|
||||
|
||||
// Get any files containing lid state
|
||||
|
|
Loading…
Reference in a new issue