3
2
Fork
You've already forked timecheck
5

refactor status storage #21

Open
opened 2020年06月16日 11:04:15 +02:00 by jonas-l · 6 comments
Contributor
Copy link

I am not sure if splitting the status into multiple files is the optimal solution, e.g. the config is saved as one single file

Yeah this is not perfect.

talking of TimeLimit, I count the used times in a sqlite table which stores the time per day number (days since 1970) and relevant time slot (e.g. from 6 to 9 o clock); old entries are deleted after some time; maybe to complex for this use case, but maybe some aspects of this can be useful

I don't think that sqlite is a good option here because we try to keep the dependencys as low as possible....

Then I think putting all variables into a file (like the config file) would be a good idea

> I am not sure if splitting the status into multiple files is the optimal solution, e.g. the config is saved as one single file > Yeah this is not perfect. > talking of TimeLimit, I count the used times in a sqlite table which stores the time per day number (days since 1970) and relevant time slot (e.g. from 6 to 9 o clock); old entries are deleted after some time; maybe to complex for this use case, but maybe some aspects of this can be useful > I don't think that sqlite is a good option here because we try to keep the dependencys as low as possible.... Then I think putting all variables into a file (like the config file) would be a good idea
Collaborator
Copy link

And then just source this file?

And then just source this file?
Author
Contributor
Copy link

The config file is not sourced but parsed, so I think sourcing a status file (which - in contract to the config file - must be writable by the script itself) is not a good idea.

The config file is not sourced but parsed, so I think sourcing a status file (which - in contract to the config file - must be writable by the script itself) is not a good idea.
Collaborator
Copy link

Yeah didn't though about the writing part.... but the status file must not really be writeable by humans so we could just write one value per line in a predefined order or so.

Yeah didn't though about the writing part.... but the status file must not really be writeable by humans so we could just write one value per line in a predefined order or so.
Author
Contributor
Copy link

Why not like the config file:

[status file] -> [status file content] | [empty]
[status file content] -> [config line] [newline] [status file content] | [config line]
[config line] -> [key]=[value] | (space|tab)*
[key] -> (any character except =)*
[value] -> (any character except newline)*

Another aspect: Is there any reason why you're saving the config, script and status in the same directory?

Why not like the config file: ``` [status file] -> [status file content] | [empty] [status file content] -> [config line] [newline] [status file content] | [config line] [config line] -> [key]=[value] | (space|tab)* [key] -> (any character except =)* [value] -> (any character except newline)* ``` Another aspect: Is there any reason why you're saving the config, script and status in the same directory?
Collaborator
Copy link

Another aspect: Is there any reason why you're saving the config, script and status in the same directory?

There is no real reason I think...

Why not like the config file:

Yeah thats probably the best way

> Another aspect: Is there any reason why you're saving the config, script and status in the same directory? There is no real reason I think... > Why not like the config file: Yeah thats probably the best way
Owner
Copy link

Another aspect: Is there any reason why you're saving the config, script and status in the same directory?

There is no real reason I think...

No, there is no reason. Was just my first idea.

Why not like the config file:

Yeah thats probably the best way

yes. But I'm not that experienced with sed yet.

> > Another aspect: Is there any reason why you're saving the config, script and status in the same directory? > > There is no real reason I think... No, there is no reason. Was just my first idea. > > Why not like the config file: > > Yeah thats probably the best way yes. But I'm not that experienced with sed yet.
Sign in to join this conversation.
No Branch/Tag specified
master
testing
No results found.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nuron/timecheck#21
Reference in a new issue
nuron/timecheck
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?