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.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill implement-session-based-image-viewer-timerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.8 KB, 528 tokens by cl100k_base, as published. Nobody here has run it
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.,
self.togsess_mode) to determine the active mode. - Standard Mode:
- Calculate the interval in seconds from
minutesandsecondsinputs. - Store the result as an integer.
- Calculate the interval in seconds from
- Session Mode:
- Parse a list of strings (e.g.,
['5 pics for 30s', '5 pics for 1m']) into a list of tuples(num_pics, duration_seconds). - Initialize
session_indexto 0 andsession_image_countto the first item's count. - Set the initial
timer_intervalto the first item's duration.
- Parse a list of strings (e.g.,
- Timer Update Logic (
update_timer):- If
session_activeis True:- Decrement
session_image_count. - If
session_image_count<= 0:- Increment
session_index. - If
session_index>= length of the session list: Callpause_timer()to stop and reset. - Else: Update
timer_intervalto the new session's duration and resetsession_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
session_active: Resetsession_indexto 0 andsession_image_countto the first session's count.
- Cancel any scheduled timer event (e.g.,
- Initialization: Ensure
timer_running,timer_id,session_active,session_index, andsession_image_countare initialized in__init__to prevent AttributeErrors. - Type Safety: Ensure
dialog.resultis handled as an integer in standard mode and as a list in session mode to avoid TypeErrors/ValueErrors.
Triggers
- implement session timer logic
- switch between standard and session mode timer
- timer based on image count list
- pause timer after session list ends
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.