mbucc / punch-time-tracking Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/punch-time-tracking
License: GNU General Public License v3.0
Automatically exported from code.google.com/p/punch-time-tracking
License: GNU General Public License v3.0
It would also be nice for the script to recognize the TODOTXT_CFG_FILE
environment variable to detect alternate todo.cfg file locations, as well
as scanning for .todo.cfg in the users home directory (I believe you can
look for the file in the users home directory by doing something like
os.path.expanduser('~/todo.cfg') or '~/.todo.cfg' for the dotfile variant.
Original issue reported on code.google.com by [email protected]
on 6 Jul 2009 at 9:24
What steps will reproduce the problem?
1. Delete punch.dat (or fresh install)
2. Run 'punch rep' command
3. Stack trace is produced because punch.dat is not found
What is the expected output? What do you see instead? Display no output or
a warning message.
Please use labels and text to provide additional information.
Original issue reported on code.google.com by [email protected]
on 1 Jul 2009 at 9:43
What steps will reproduce the problem?
1. Start a task - eg. punch in 10
2. Run archive command - eg. punch ar 2009-01-01
3. Verify that unfinished task has been deleted - eg. punch what - result
is "no active task"
What is the expected output? Unfinished task should remain in punch.dat file.
Original issue reported on code.google.com by [email protected]
on 24 Mar 2009 at 2:41
What steps will reproduce the problem?
1. Downloaded v1.3
2. Set alias
3. Ran program, received errors.
What is the expected output? What do you see instead?
Receiving multiple errors. See below for output.
What version of the product are you using? On what operating system?
v1.3 on Snow Leopard w/ Python 2.6.1
Please provide any additional information below.
: No such file or directory
from: can't read /var/mail/os.path
from: can't read /var/mail/os
~/development/source/scripts/punch.py: line 24: import: command not
found
~/development/source/scripts/punch.py: line 25: import: command not
found
~/development/source/scripts/punch.py: line 26: import: command not
found
~/development/source/scripts/punch.py: line 27: import: command not
found
~/development/source/scripts/punch.py: line 28: import: command not
found
~/development/source/scripts/punch.py: line 29: import: command not
found
: command not founddevelopment/source/scripts/punch.py: line 30:
from: can't read /var/mail/optparse
: command not founddevelopment/source/scripts/punch.py: line 32:
: command not founddevelopment/source/scripts/punch.py: line 33:
: command not founddevelopment/source/scripts/punch.py: line 39:
~/development/source/scripts/punch.py: line 40: syntax error near
unexpected token `('
~/development/source/scripts/punch.py: line 40: `class
PunchCom'andError(ValueError):
Original issue reported on code.google.com by [email protected]
on 8 Dec 2009 at 1:53
What steps will reproduce the problem?
1. Upgrade todo.txt to version 2.4
2. Run any punch command (eg. punch rep)
3. Python error - unable to resolve TODO_FILE from the property dictionary.
What is the expected output? What do you see instead?
Valid configuration information stored in the property dictionary.
Original issue reported on code.google.com by [email protected]
on 30 Jun 2009 at 11:55
By default `punch report` should report the _total_ time spent on each task
(not grouped by day). To group by day (like punch currently does) the command
should be `punch report --daily`. Other groupings could then be added:
punch report --hourly
punch report --weekly
punch report --fortnightly
punch report --monthly
punch report --bimonthly
punch report --yearly
...even specifying custom time periods somehow.
Original issue reported on code.google.com by [email protected]
on 9 Nov 2011 at 7:56
What steps will reproduce the problem?
1. Checkout trunk
2. Run "python /foo/bar/todo/todo.actions.d/Punch.py"
3. Receive an error stating that "todo.cfg" could not be found.
What is the expected output? What do you see instead?
It would be nice if I could run Punch.py from any directory, not just my todo
or $HOME dirs.
What version of the product are you using? On what operating system?
Trunk on Ubuntu 11.10.
Please provide any additional information below.
Here's the patch. In Punch.py, change line 106 from this:
paths = [ getenv("HOME"), "."]
...to this:
paths = [ getenv("HOME"), ".", getenv("TODOTXT_HOME")]
Then, if a user chooses to set a TODOTXT_HOME variable, she can then run punch
from any directory.
Original issue reported on code.google.com by [email protected]
on 2 Feb 2012 at 3:07
What steps will reproduce the problem?
1. TODO_DIR is set as: export TODO_DIR="$HOME/todo"
2. TODO_FILE is set as: export TODO_FILE="$TODO_DIR/todo.txt"
3. Call to self.resolve(self.propDict.get('TODO_FILE'))
What is the expected output? What do you see instead?
The result should be '/path/to/home/todo/todo.txt', instead the resolve return
'$HOME/todo/todo.txt'
What version of the product are you using? On what operating system?
Using version 1.2 on MacOSX
Please provide any additional information below.
To fix this you could put the following if on the if token != -1 block:
>>>
if '$' in value:
value = self.resolve(value)
>>>
Original issue reported on code.google.com by [email protected]
on 9 Feb 2012 at 3:00
Attachments:
What steps will reproduce the problem?
1. Use archive command to archive all data records
2. Use punch in to start a new time record
3. Python stack trace is dumped
What is the expected output? What do you see instead?
$ punch in 13
Traceback (most recent call last):
File "Punch.py", line 496, in <module>
punch.execute()
File "Punch.py", line 57, in execute
self.execute_in()
File "Punch.py", line 297, in execute_in
self.add_in_line(line_num)
File "Punch.py", line 241, in add_in_line
if self.last_punch_line_complete() == False:
File "Punch.py", line 182, in last_punch_line_complete
lastrec = self.get_last_punch_rec()
File "Punch.py", line 160, in get_last_punch_rec
lastline = (lines[len(lines)-1]).strip()
IndexError: list index out of range
Please use labels and text to provide additional information.
Original issue reported on code.google.com by [email protected]
on 6 Apr 2009 at 11:59
I did have a couple of issues trying to get it to work however due to my
having a slightly different setup than you have. The script doesn't appear
to expand shell variables when parsing todo.cfg. For example, I specify my
TODO_DIR as $HOME/todo, and my todo.txt file as $TODO_DIR/todo.txt, which
Punch.py doesn't detect.
Original issue reported on code.google.com by [email protected]
on 6 Jul 2009 at 9:23
What steps will reproduce the problem?
1.
2.
3.
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
punch rep shows total time, and time taken for each task.
It might be useful to show the time taken as a percentage of punched in time
for that day.
i.e. when you punched in 10 hrs on a particular day, and if a task took 1 hr,
then it should show 10%
Attached is a diff that simplifies the rep method, and prints the percentage
next to each task.
Original issue reported on code.google.com by [email protected]
on 12 Nov 2011 at 7:14
Attachments:
punch list (ls) : list current entries in punch.dat with line/rec numbers.
Fashion after todo's ls command.
punch modify (mod) : Change the start and/or end time of past task. Make it
interactive? Can't think of a better way to do it at the moment - command
line switches get hairy.
eg:
bash> punch mod 14
Modifying task "blah blah blah"
Start time (2009-04-17 08:30:00)? 2009-04-17 08:15:00
End time (2009-04-17 11:27:35)? 2009-04-17 11:30:00
Original issue reported on code.google.com by [email protected]
on 17 Apr 2009 at 5:47
What steps will reproduce the problem?
1. Place a todo.sh config in ~/.todo/config
2. Try to punch something
3. Could not find config error.
What is the expected output? What do you see instead?
Error message: Could not find config
What version of the product are you using? On what operating system?
1.3, Fedora 18
Please provide any additional information below.
Patch with the fix is attached.
Original issue reported on code.google.com by [email protected]
on 10 Feb 2013 at 10:00
Attachments:
punch-time-tracking + todo.sh was almost all I needed to track my time, but I
wanted to be able to take notes during the punched-in times, and have the notes
get spit out in the report based on the timestamps.
Here is the `diff Punch.py ~/todo/ModifiedPunch.py`
* note, the first change was just to allow me to use ~/.todo/config as my
todo.cfg.
* note also, that I've decided to use a bash function to record my notes - at
the bottom, below the diff
* lastly, note, that notes.txt needs to be stored in the same directory as
punch.dat
A colleague of mine, who is versed in python made the following changes.
107,108c107,108
< files = [ "todo.cfg", ".todo.cfg" ]
< if getenv("TODOTXT_CFG_FILE") == None:
---
> files = [ "todo.cfg", ".todo.cfg", ".todo/config" ]
> if getenv("TODOTXT_CFG_FILE") == None:
178a179,187
> def open_notes_file(self,mode='a'):
> """Open the notes file - notes.txt - in the user's TODO_DIR."""
> name = self.resolve( self.propDict['TODO_DIR'] + "/notes.txt" )
>
> if not os.path.exists(name):
> open( name, 'w' ).close()
>
> self.notesFile = open( name, mode )
>
406a416
> noteDict = dict()
407a418
> self.open_notes_file('r')
408a420
> notes = self.notesFile.readlines()
440a453,465
> # For each date/task in the tree, store a subtree
with
> # notes for the date/task
> noteKey = dateKey + '-' + task
> if( noteKey in noteDict.keys()):
> noteList = noteDict[noteKey]
> else:
> noteList = list()
>
> # Search for notes.
> for note in notes:
> if start <= note[0:15] and note[0:15] <= end:
> noteList.append( note )
>
444a470
> noteDict[noteKey] = noteList
470a497,508
> noteKey = dateKey + '-' + taskKey
> if noteKey in noteDict:
> for note in noteDict[noteKey]:
> print '\t\t' + note[16:],
> notes.remove( note )
> heading = False
> for note in notes:
> if note[0:8] == dateKey:
> if not heading:
> heading = True
> print '\tOther Notes:'
> print '\t\t' + note[16:],
575c613
<
\ No newline at end of file
---
>
here is the notes function. i put it in .bash_profile on my mac, but it works
in .bashrc
n() {
echo $(date "+%Y%m%dT%H%M%S => ") "$@" | tee -a ~/Documents/todo/notes.txt
}
Usage is simple.
alauppe-i7:~ alauppe$ p in 1
Start timer on: AA task
alauppe-i7:~ alauppe$ n this is a note for AA task
20120116T175359 => this is a note for AA task
alauppe-i7:~ alauppe$ n this is another note for AA task
20120116T175403 => this is another note for AA task
alauppe-i7:~ alauppe$ p in 2
Stop timer on: AA task
Start timer on: AB task
alauppe-i7:~ alauppe$ n this is a note for AB task, put in after the first 2 in
AA
20120116T175427 => this is a note for AB task, put in after the first 2 in AA
alauppe-i7:~ alauppe$ p in 1
Stop timer on: AB task
Start timer on: AA task
alauppe-i7:~ alauppe$ n this is the last note, for AA
20120116T175438 => this is the last note, for AA
alauppe-i7:~ alauppe$ p rep
2012-01-16 (0 minutes):
AA task (0 minutes)
=> this is a note for AA task
=> this is another note for AA task
AB task (0 minutes)
=> this is a note for AB task, put in after the first 2 in AA
am i missing anything? I've uploaded my modified copy of Punch.py
Original issue reported on code.google.com by [email protected]
on 16 Jan 2012 at 10:56
Attachments:
What steps will reproduce the problem?
1. cd to a directory other than home directory
2. "punch rep" or similar command
3. Error: Could not find configuration file (todo.cfg)
What is the expected output?
Program should be able to locate the configuration file and run as
expected. Once the configuration file is located, all other files will be
findable via path information in the configuration file.
Original issue reported on code.google.com by [email protected]
on 25 Mar 2009 at 12:57
Currently `punch report` only supports reporting time spent per task. I think
it would be useful if it could group tasks by pattern-matching and report time
spent per group. For example, I add a number of different tasks for the same
project:
t add 'Work on ticket #3245 p:foo'
t add 'Work on ticket #564 p:foo'
t add 'Work on ticket #35 p:foo'
With todo.txt I can do:
t ls 'p:foo'
and it'll print out all my tasks matching the pattern 'p:foo'. It would be
nicer if I could do:
punch report 'p:foo'
and punch would find all the tasks that match the pattern and report a single
combined time spent on p:foo rather than time spent per task (it could also
print out time spent per task below, indented):
2011-11-09 (2 minutes):
p:foo (2 minutes):
Work on ticket #3245 p:foo (1 minute)
Work on ticket #35 p:foo (1 minute)
More than one pattern could be given on the command line, so when I want to
send a timesheet for my foo job and another timesheet for my bar job I would do:
punch report 'p:foo' 'p:bar'
and this would print out a report of time spent on foo and time spent on bar:
2011-11-09 (3 minutes):
p:foo (2 minutes):
Work on ticket #3245 p:foo (1 minute)
Work on ticket #35 p:foo (1 minute)
p:bar (1 minute)
Work on ticket #17 p:bar (1 minute)
Note: some tasks might match both patterns, and that's fine.
Note: some tasks might not match any of the given patterns. These could be
omitted from the report, or they could be reported at the end, not grouped
under any pattern.
Original issue reported on code.google.com by [email protected]
on 9 Nov 2011 at 6:12
What steps will reproduce the problem?
1. start a task 'punch in 9'
2. edit the punch.dat file, and save
3. end the task (punch out)
What is the expected output? What do you see instead?
When the file is modified in an editor, a line break is added to the end of
the file. When adding the end time to the last record, that line break is
preserved, and the record becomes malformed.
Rather than having:
task\tstart-time\tend-time
You get:
task\tstart-time
\tend-time
This throws off reporting, archiving, etc.
Please use labels and text to provide additional information.
Original issue reported on code.google.com by [email protected]
on 26 Mar 2009 at 11:29
When using 'punch in', allow user to enter a starting time rather than only
allowing current time.
eg. punch in -s 09:30:00 31
Original issue reported on code.google.com by [email protected]
on 13 May 2009 at 10:59
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.