allow set LIMITS_PER_WEEKDAYS time duration in hours or minutes instead of seconds only in timekpr.username.conf

Bug #1928221 reported by bcag2
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Timekpr-nExT
Won't Fix
Wishlist
Eduards Bezverhijs

Bug Description

Hello, thank a lot for this useful soft.

I mainly set time from ssh, so I change values directly in timekpr.username.conf file, and it is not always easy to convert time duration in seconds, so my improvement suggest is to allow :

LIMITS_PER_WEEKDAYS = 8H;7H;4H;270M;30000;30000;30000

so default stay in seconds (nothing added after value)
hours, adding H after value
minutes, adding M or MN after value

or as we can see in this SO ticket : https://stackoverflow.com/questions/6402812/how-to-convert-an-hmmss-time-string-to-seconds-in-python

allow HH:MM:SS, so :
LIMITS_PER_WEEKDAYS = 08:00:00;07:00:00;04:00:00;04:30:00;

Changed in timekpr-next:
importance: Undecided → Wishlist
assignee: nobody → Eduards Bezverhijs (mjasnik)
Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

I'm not sure this would be beneficial change, as everything in timekpr is in seconds.

But before deciding what to do, can You please describe use case, why you need to change the values so often?
My imaginary use case was - once set, it's rarely touched.

Why don't you use commandline interface for timekpr? Like:
    timekpra --help

Revision history for this message
bcag2 (bcag2) wrote :

My son have access on two computers, an old one, family usage, and another to play and work at home. So depending how he works at school, how he helps at home, what time he spent the day before, if he plays or not, if he spent time or family PC, I very often change day time and allowed hours. For example, by default, allowed_hours finish at 19 or 20, but if he spent a day outside, I open time to 21 or 22h at week-end. If he played to much, I reduce time tomorrow, so a week after, he require to come back to usual time.

I saw one time timekpra CLI but as I use often settings file, I think it is easier to me to change the file directly because I see all settings.

Regards
B

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

Ok, it seems you are doing this quite extensive.

The following may help you, if you did not know this before.

You do not need to change limits for days, when you need to extend allowance for today. If you need to add couple of hours to this day, just simply do this:
    sudo timekpra --settimeleft username + 7200
The only thing to be aware of that hour intervals are not extended by the above command.

If you need to see what settings your user has, just issue:
    sudo timekpra --userinfo username

If you know what you're looking for, just grep the output.
For example, this would get you how much he has left:
    sudo timekpra --userinfo username | grep TIME_LEFT

The values in --userinfo are the values you can copy & paste as input values to various commands.

So this would get you allowed hours for Wednesday:
    sudo timekpra --userinfo username | grep ALLOWED_HOURS_3
Lets pretend that it returns:
    ALLOWED_HOURS_3: 16;17;18;19;20

Copy the value to the input command and change it (add 21 to the end), for example:
    timekpra --setallowedhours username 3 "16;17;18;19;20;21"

Hope this eases your management.

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

Have you checked whether the above helps you?

I have thought about it and I could add 00:00:00:00 support to cmdline version.

Revision history for this message
bcag2 (bcag2) wrote :

Hi,
Thank you for you CLI explanations but even if I am comfortable with CLI, it requires more manipulations than edit conf file with vim, especially to change ALLOWED_HOURS. After ssh connect, I just run `Ctr-R th` and `vi … /timekpr.thomas.conf` is show and I accept to open it, then I make my changes, save and quit the terminal.

Revision history for this message
Eduards Bezverhijs (mjasnik) wrote :

I would not like to change this at this point of time. Maybe when I (if ever) will redesign smth in timekpr...

Changed in timekpr-next:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.