Git Product home page Git Product logo

Comments (11)

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024 1

An option to skip weekends sounds nice, yes! But even the basic ability to increase/decrease due dates would be a big step forward for me.

It would also be great to have a binding to clear the due date as well as to add one -- which could default to, say, tomorrow (or any relative date syntax understood by pter -- the user could just set the right string in the config).

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Uh, nice idea! I like that! Maybe even a mode/option that skips weekends? 🤔

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

I started putting the changes into the codeberg repo even though they're not released yet. Increase and decrease has been added as well as the skip-weekend.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

clear-due is implemented, too.

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

Awesome!

I'm testing this and will report any issues. Here's one: calling dec-due on a task with no due date results in a crash:

[CRITICAL] Pter crashed with exception: list index out of range
  File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/curses.py", line 3025, in run_cursesui
    window.run()
  File "/usr/local/lib/python3.11/dist-packages/cursedspace-1.5.2-py3.11.egg/cursedspace/application.py", line 59, in run
    raise exception
  File "/usr/local/lib/python3.11/dist-packages/cursedspace-1.5.2-py3.11.egg/cursedspace/application.py", line 52, in run
    self.main()
  File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/curses.py", line 1753, in main
    self.functions[fnc]()
  File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/curses.py", line 2739, in do_decrease_due
    due = utils.task_parse_due(task.task)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pter-3.15.2.dev0-py3.11.egg/pter/utils.py", line 81, in task_parse_due
    return datetime.datetime.strptime(task.attr_due[0], Task.DATE_FMT).date()
                                      ~~~~~~~~~~~~~^^^

Calling inc-due on a task with no due date also crashes pter ("list index out of range") -- but I would expect it to add 1d.

Same problem with calling clear-due on a task with no due.

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Yeah, when the except catches ValueErrors but ignores the KeyError 🤦 I'll fix it later today.

Meanwhile I was wondering; should inc-due/dec-due create a due date in case there isn't one yet? Since it's very easy to remove a due date it might be convenient to create one, too?

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

I would love to have the ability to quickly create one, yes! But I'm not sure about the defaults.

With inc-due it seems intuitive -- pter could default to today and then increment per the config setting. Perhaps dec-due should default to today too? Defaulting to something like yesterday doesn't make much sense to me :) What are your thoughts?

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

That's kinda what I had in mind, too. Adding a due date in the past for an existing task seems a bit stress-inviting. And if the user really wants that level of stress, they can keep hitting the same key to set the due date as far in the past as they need 🤷

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

Sounds good to me!

from pter.

vonshednob avatar vonshednob commented on May 28, 2024

Alright, crash is fixed and due date creation is added!

from pter.

andrei-a-papou avatar andrei-a-papou commented on May 28, 2024

Seems to work fine, already using it! Thank you!

from pter.

Related Issues (20)

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.