Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to clock out early #12

Open
kendallm opened this issue Jun 15, 2021 · 5 comments
Open

Add ability to clock out early #12

kendallm opened this issue Jun 15, 2021 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@kendallm
Copy link
Contributor

kendallm commented Jun 15, 2021

Currently, the script sets a time block for clocking hours and then runs until that timeblock expires. I have had cases where I need to stop working earlier than expected and would still need to clock out manually.

It would be nice to have a way to kill the script and have it clock out for you. An easy route would be to handle the Interrupt Signal (ctrl+c) and clock out before exiting.

Another option would be to run the current process in a separate thread and then listen for a command from the user to tell the script to clock out early. This would be a cleaner implementation, but may be a bit more complicated to implement.

I imagine the workflow being something like:

~/D/OneUSGAutomaticClock ❯❯❯ python3 clock_manager.py -u username -hrs 2                                                                                 

Clocking 2.0 hours...

Enter command: Status
--- 30 minutes of work done, 1.5 hours of work remaining

Enter command: Clock Out
--- 30 minutes of work done, attempting to clock out
...
...
--- Clock out successful, 30 minutes clocked

~/D/OneUSGAutomaticClock ❯❯❯ 
@kendallm kendallm changed the title Ability to clock out early Add ability to clock out early Jun 15, 2021
@Shaun-Regenbaum
Copy link
Owner

I like the idea. I think your first idea is solid. Would there ever be a case where someone would want to kill the script without clocking out? The only case I can think of is if you are just messing around with the script. Otherwise, I think we could easily implement that.

@Shaun-Regenbaum
Copy link
Owner

Also, right now I feel like the messaging system is a bit cluttered, so I like your simpler way of showing info.

@Shaun-Regenbaum Shaun-Regenbaum added enhancement New feature or request help wanted Extra attention is needed labels Jun 17, 2021
@kendallm
Copy link
Contributor Author

Just thinking through this, if we do have a way to clock out early from the CLI then we could optionally use a headless browser instead of a full window.

@Shaun-Regenbaum
Copy link
Owner

Have you ever used a tool like that? Does Selenium offer something like that?
I suspect people may actually prefer seeing the window as it reassures them that everything is working, but I'd love to hear your thoughts!

@kendallm
Copy link
Contributor Author

It's a flag built into selenium. I actually use it now with this tool.

If I am running the script from my server I need to avoid having a window try to pop open. Using headless mode works for that.

https://developers.google.com/web/updates/2017/04/headless-chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants