AutoSkill Implement Session-Based Image Viewer Timer
Implement a dual-mode timer logic for an image viewer that switches between a standard fixed interval and a session-based interval iterating through a list of image counts and durations.
install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/implement-session-based-image-viewer-timer" ~/.claude/skills/ecnu-icalk-autoskill-implement-session-based-image-viewer-timer && rm -rf "$T"
manifest:
SkillBank/ConvSkill/english_gpt4_8_GLM4.7/implement-session-based-image-viewer-timer/SKILL.mdsource content
Implement Session-Based Image Viewer Timer
Implement a dual-mode timer logic for an image viewer that switches between a standard fixed interval and a session-based interval iterating through a list of image counts and durations.
Prompt
Role & Objective
You are a Python/Tkinter developer implementing a dual-mode timer for an image viewer. The timer must support a standard fixed interval mode and a session-based mode where intervals change based on a predefined list of configurations.
Operational Rules & Constraints
- Mode Toggle: Use a boolean flag (e.g.,
) to determine the active mode.self.togsess_mode - Standard Mode:
- Calculate the interval in seconds from
andminutes
inputs.seconds - Store the result as an integer.
- Calculate the interval in seconds from
- Session Mode:
- Parse a list of strings (e.g.,
) into a list of tuples['5 pics for 30s', '5 pics for 1m']
.(num_pics, duration_seconds) - Initialize
to 0 andsession_index
to the first item's count.session_image_count - Set the initial
to the first item's duration.timer_interval
- Parse a list of strings (e.g.,
- Timer Update Logic (
):update_timer- If
is True:session_active- Decrement
.session_image_count - If
<= 0:session_image_count- Increment
.session_index - If
>= length of the session list: Callsession_index
to stop and reset.pause_timer() - Else: Update
to the new session's duration and resettimer_interval
.session_image_count
- Increment
- Decrement
- Else: Use the standard fixed interval.
- If
- Pause Logic (
):pause_timer- Cancel any scheduled timer event (e.g.,
).root.after_cancel - Set
.timer_running = False - If
: Resetsession_active
to 0 andsession_index
to the first session's count.session_image_count
- Cancel any scheduled timer event (e.g.,
- Initialization: Ensure
,timer_running
,timer_id
,session_active
, andsession_index
are initialized insession_image_count
to prevent AttributeErrors.__init__ - Type Safety: Ensure
is handled as an integer in standard mode and as a list in session mode to avoid TypeErrors/ValueErrors.dialog.result
Triggers
- implement session timer logic
- switch between standard and session mode timer
- timer based on image count list
- pause timer after session list ends