The script tickettimer.py
can be used to run all scripts.
call it as follows:
python ./tickettimer.py function "Possible Arguments"
I created this repo to practice my Python and have something I can actually use. It consists out of following usable functions:
- entry
- print-tickets
- delete
- clear
- mock-data
- rename
- stop
- time-worked
- update
- Extra functionalities
- Possible later additions
You will need to have Python3 installed for both. To run any of the scripts, make sure you are located in the root directory of the project (The one that includes /myModules, /resources and the two scripts). Both the scripts use a file called list.json. If you do not yet have it, the entry script will create it for you.
You can call this function by using following command:
python ./tickettimer.py entry "Ticket name"
If the given ticket name has not yet been used, a new ticket entry will be created, immediately setting it to active. If the given ticket name has already been used and is currently active, it will be put inactive and the time spent will be updated. If the given ticket name has already been used and is currently inactive, it will be put active.
There will always be at most one ticket active.
Don't worry! All entries that do not have today's date, will be cleared automatically.
You can all this function by using following command:
python ./tickettimer.py print-tickets
Will list all tickets of today, including their time worked in minutes and if they are currently active or not.
You can call this function by using following command:
python ./tickettimer.py delete "Ticket name"
This will delete the entry from the list.
You can call this function by using following command:
python ./tickettimer.py clear
This will replace the file input with an empty array, ready for new use.
You can call this function by using following command:
python ./tickettimer.py mock-data
This will create a list with mock data to test on.
You can call this function by using following command:
python ./tickettimer.py rename "old ticket" "new ticket"
This will update the old ticketname to the new ticketname if it exists. If it doesn't exist, you will receive an error in the console and the script will stop.
You can call this function by using following command:
python ./tickettimer.py stop
This will stop any running ticket.
You can call this function by using following command:
python ./tickettimer.py time-worked
This will print the total time worked (in minutes) to your console.
You can call this function by using following command:
python ./tickettimer.py update
This will update the currently active ticket startTime and timeWorkedInMinutes. If a ticket is not active, it will be skipped.
I have added a Logger file to make printing even easier. Feel free to implement extra things to it.
Things that might be added are visible in the Issues.
You can always fork this project if you want to add something.
Any change requests can be done through issues.