Request to accept ideas for additional features
### General idea
I would like to add another feature to the program: weekly and monthly quota of the time in addition to the daily time. I would like to define the changes in such a way, that you will agree to incorporate them into your repository and eventually push them upstream. I believe there is no need for another fork of this great project. Please read the changes I propose and tell me, if you have any suggestions.
### Completely new timefile format
For that I will re-write `gettime()` so it does not re-write the timefile by the midnight, but rather keeps log of all logged time, perhaps in the form of litesql db, or in the txt format of
```
<user> <date> <total_time_in_sec>
```
sorted by the date. Old entries will get pruned or moved elsewhere.
### New UI tabs
I will also provide an option to specify weekly/monthly allowance in the glade UI.
Right now I plan to add the list that will always allow to add entries (`time limitations`) like this:
`Allow at most <amount of time> <minutes|hours> since <weekday|day of month|custom>... `
* weekday: `... <monday|
* day of month: `...<01|
* custom: `...last <number> of days`.
The last option, the `custom`, seems intriguing for me, as it will not bound a kid to any artificial time boundary, like 1st of the month. Parent (me) will get the option to specify, that the kid can not play more than e.g. 2 hours per average in each window of three months.
Each entry must be satisfied in order for the kid to be able to login.
There will also be an option to grant additional time - as a reward. It will be implemented as logging negative time into the new timefile at the time of issuance.
### Modifications to the main loop in `timekpr.py`.
I would define a new function "checkTimeQuota()" which would be used instead of lines timekpr.py:279-305. It will return amount of time that is left for today.
The algorithm will be as follows:
1. Check the daily quotas as before (copy-paste lines 279-305) and get the amount of daily time left.
2. Iterate over all entris in `time limitations` and call `checkTimeLimit()` to check each one in turn. Checking the entry will yield the amount of time that is left, assuming that the account is logged in forever.
3. Return the minimum of all these numbers (and lock the account if the number is negative)
Checking the entry will be implemented like that:
`checkTimeLimit
The `horizon_date` will depend on the type of the entry. For `<weekday>` entries it will be the last `<day of the week>`, for `<day of month>` it will be last chosen day, and for `<custom>` it will be simply last `<number of days>`.
Return value would be `<amount of time> - sum(queried_
### That's it.
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Adam Ryczkowski for more information if necessary.