Giter Site home page Giter Site logo

punch-time-tracking's People

Stargazers

 avatar

Watchers

 avatar  avatar

punch-time-tracking's Issues

todo.cfg file not found when in a custom location

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

Report command throws exception when there is no punch.dat file

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

Archive command deletes "in progress" task

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

Execution issue

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

Format change in todo.cfg version 2.4 breaks punch.py

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

Daily, weekly etc. reporting options

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

Simple patch that makes it possible to run Punch.py from any directory

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

Resolve variables with more than one $

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:

Archiving all records leads to an unusable punch.dat file

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

Shell variables in configuration file are not expanded

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

punch report, show time taken as percentage

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:

Modify command needed to avoid manually editing punch.dat

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

Cannot find todo.sh default config location

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:

Added ability to take notes during punch-in time, and have them output with the punch.py report

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:

Search for todo.cfg in home directory or at -d location

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

Report by pattern

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

Manually edited punch.dat file can lose a record

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.