Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior circa interruptions #9

Open
nathanielhourt opened this issue May 5, 2017 · 0 comments
Open

Weird behavior circa interruptions #9

nathanielhourt opened this issue May 5, 2017 · 0 comments

Comments

@nathanielhourt
Copy link

nathanielhourt commented May 5, 2017

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": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant