You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thank you for developing and sharing this great tool!
I skimmed through the source code to try and figure out how to add this feature myself.
Your python skills are way more pythonic than mine however, and I didn't get very far. Edit:Completing #18 will probably take my Python skills to the next level - so thanks for that. I might be able to add this feature myself!
Here is what I wanted to do:
adding a new -d (for details) argument utt report --from 2019-07-12 --to 2019-07-13 -d
desired output:
------ Friday, Jul 12, 2019 (week 28) to Saturday, Jul 13, 2019 (week 28) ------
Working Time: 15h00
Break Time: 0h00
----------------------------------- Projects -----------------------------------
(15h00) OS: Bring tutors up to speed, create google forms for
new student repos, setting up course (Github website/repos
etc + liasing with staff to organise things), Update website, write
script to create new student repos, write script to delete old
repos, write script to scrape and backup old homework repos
---------------------------------- Activities ----------------------------------
(1h00) OS: Bring tutors up to speed
(1h00) OS: create google forms for new student repos
(5h00) OS: setting up course (Github website/repos etc + liasing with staff to organise things)
(1h00) OS: Update website
(5h00) OS: write script to create new student repos
(1h00) OS: write script to delete old repos
(1h00) OS: write script to scrape and backup old homework repos
----------------------------------- Details ------------------------------------
2019-07-12:
(5h00) 12:00-17:00 OS: setting up course (Github website/repos etc + liasing with staff to organise things)
2019-07-13 :
(1h00) 12:00-13:00 OS: Update website
(1h00) 13:00-14:00 OS: Bring tutors up to speed
(1h00) 14:00-15:00 OS: write script to scrape and backup old homework repos
(1h00) 15:00-16:00 OS: write script to delete old repos
(1h00) 16:00-17:00 OS: create google forms for new student repos
(5h00) 17:00-22:00 OS: write script to create new student repos
The date separated activities aren't important. I guess having:
...
----------------------------------- Details ------------------------------------
(5h00) 12:00-17:00 OS: setting up course (Github website/repos etc + liasing with staff to organise things)
(1h00) 12:00-13:00 OS: Update website
(1h00) 13:00-14:00 OS: Bring tutors up to speed
(1h00) 14:00-15:00 OS: write script to scrape and backup old homework repos
(1h00) 15:00-16:00 OS: write script to delete old repos
(1h00) 16:00-17:00 OS: create google forms for new student repos
(5h00) 17:00-22:00 OS: write script to create new student repos
is fine too.
Mainly, this feature would allow one to see the actual date-time of the hours worked.
I could achieve this with a script that reads the contents of utt.log,
formats the outputt to look like the 'Details' section, and finally printing it after calling utt report --from<> --to<>.
Something like this:
note this is just pseudo code
fromosimportsystemimportsys# make a file that holds the desired outputoutput=open('output.txt','w+')
#Get the time period as argument to script:from_date=sys.argv[1]
to_date=sys.argv[2]
# Get time period (pseudo code)period=to_date-from_date#store the detailed activities here:details= []
# Go through utt.log lookng for matching dates (psseudo code)f='utt.log'withopen(f) asfile_object:
forlineinfile_object:
if(lineiswithinperiod):
details.append(line.rstrip()) # add activities occring in period# run the report command as it is now:run="utt report --from "+from_date+" --to "+to_datesys(run>>output.txt) # put the output in a textfile, we don't want it printing to terminal just yet...# add the details that we got earlier, to the output file;st='----------------------------------- Details ------------------------------------\n'output.write(st)
fordindetails:
output.write(d+"\n")
output.close()
# finally output everything to the terminalsys("cat output.txt")
This is a hack though, and I'm quite sure you'd be able to do this far easier and more elegantly
knowing the source code structure 😋
Thanks again for this awesome tool.
The text was updated successfully, but these errors were encountered:
ukrutt
added a commit
to ukrutt/utt
that referenced
this issue
Nov 5, 2019
Hi @larose + contributors,
thank you for developing and sharing this great tool!
I skimmed through the source code to try and figure out how to add this feature myself.
Your python skills are way more pythonic than mine however, and I didn't get very far.
Edit: Completing #18 will probably take my Python skills to the next level - so thanks for that. I might be able to add this feature myself!
Here is what I wanted to do:
-d
(for details) argumentutt report --from 2019-07-12 --to 2019-07-13 -d
The date separated activities aren't important. I guess having:
is fine too.
Mainly, this feature would allow one to see the actual date-time of the hours worked.
I could achieve this with a script that reads the contents of
utt.log
,formats the outputt to look like the 'Details' section, and finally printing it after calling
utt report --from<> --to<>
.Something like this:
note this is just pseudo code
This is a hack though, and I'm quite sure you'd be able to do this far easier and more elegantly
knowing the source code structure 😋
Thanks again for this awesome tool.
The text was updated successfully, but these errors were encountered: