Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Weird behavior circa interruptions #9

@nathanielhourt

Description

@nathanielhourt

The idea of "interruptions" is not well documented, and breaks the log when used. Also, it seems odd that it allows you to interrupt a task with the same task. This should probably be an error, since it probably means the user doesn't know what he's doing xD

Here's what I mean:

nathan@spiral ~ % ti on hello
Start working on hello.
nathan@spiral ~ % ti interrupt hello
So you stopped working on hello.
Start working on interrupt: hello.
You are now 1 deep in interrupts.
nathan@spiral ~ % ti interrupt goodbye
So you stopped working on interrupt: hello.
Start working on interrupt: goodbye.
You are now 2 deep in interrupts.
nathan@spiral ~ % ti fin
So you stopped working on interrupt: goodbye.
Start working on interrupt: hello.
You are now 1 deep in interrupts.
nathan@spiral ~ % ti interrupt
Need the name of whatever you are working on.
1 nathan@spiral ~ % ti fin                                                                                                                                                                              :(
So you stopped working on interrupt: hello.
Start working on hello.
Congrats, you're out of interrupts!
nathan@spiral ~ % ti fin
So you stopped working on hello.
nathan@spiral ~ % ti log 
Traceback (most recent call last):
  File "/home/nathan/.bin/ti", line 4, in <module>
    ti.main()
  File "/home/nathan/.local/lib/python3.6/site-packages/ti/__init__.py", line 451, in main
    fn(**args)
  File "/home/nathan/.local/lib/python3.6/site-packages/ti/__init__.py", line 265, in action_log
    for name, item in sorted(log.items(), key=(lambda x: x[1]), reverse=True):
TypeError: '<' not supported between instances of 'dict' and 'dict'

I suspect the cause of the breaking log is that bash color codes are sneaking into the ti-sheet, but haven't attempted to confirm this:

{
  "work": [
    {
      "name": "hello",
      "start": "2017-05-05T15:23:14.768415Z",
      "end": "2017-05-05T15:23:19.880548Z"
    },
    {
      "name": "interrupt: \u001b[32mhello\u001b[39m",
      "start": "2017-05-05T15:23:19.880548Z",
      "end": "2017-05-05T15:23:27.263428Z"
    },
    {
      "name": "interrupt: \u001b[32mgoodbye\u001b[39m",
      "start": "2017-05-05T15:23:27.263428Z",
      "end": "2017-05-05T15:23:31.220007Z"
    },
    {
      "name": "interrupt: \u001b[32mhello\u001b[39m",
      "start": "2017-05-05T15:23:31.220007Z",
      "end": "2017-05-05T15:23:40.109266Z"
    },
    {
      "name": "hello",
      "start": "2017-05-05T15:23:40.109266Z",
      "end": "2017-05-05T15:23:44.911772Z"
    }
  ],
  "interrupt_stack": []
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions