1. 11 Jun, 2015 1 commit
  2. 10 Jun, 2015 1 commit
  3. 09 Jun, 2015 3 commits
  4. 08 Jun, 2015 4 commits
    • Jacek Sowiński's avatar
      Expression-mode for del, depri, do, pri, postpone. · 0d2cedd8
      Jacek Sowiński authored
      This required some refactoring in MultiCommand and ExpressionCommand.
      
      Whole part about processing flags was refactored. Code related to flags
      from DCommand was moved into MultiCommand and reused from there in all
      "multi" commands.
      
      New attribute: ExpressionCommand.last_argument. Should be set to True if
      command is using the last argument as something other than todo ID or
      part of an expression (as in case of postpone or pri). By default set to
      False.
      
      New method: MultiCommand.execute_not_multi(): wrapper for functionality
      not connected with todo IDs (like `topydo edit` or `topydo edit -d`).
      
      New attribute: MultiCommand.multi_mode: Should be set to True if user
      wants to operate on multiple todo items. True by default.
      
      New method: MultiCommand.get_todos_from_expr(): gets todo IDs based on
      expression and puts it in MultiCommand.todos.
      
      EditCommand._open_in_editor() now accepts only one argument - file to
      editing. It handles now also OSError exceptions. It is used also to
      opening todo.txt and done.txt.
      
      MultiCommand.get_todos() doesn't accept anymore todo IDs as an argument.
      Instead it's using inherited Expression.last_argument` to decide upon
      where to find todo IDs.
      0d2cedd8
    • Jacek Sowiński's avatar
      Tiny rename inside `DCommand.process_flags()` · b9615d52
      Jacek Sowiński authored
      Now desired result of DCommand.get_flags() should be more apparent.
      b9615d52
    • Jacek Sowiński's avatar
      Move DCommand from commands to lib · 9b12ab96
      Jacek Sowiński authored
      9b12ab96
    • Jacek Sowiński's avatar
      Unify calling the editor in EditCommand · 187e9ed8
      Jacek Sowiński authored
      Now every call to editor is done by `EditCommand._open_in_editor()` and
      whole process of getting editor name is also done there.
      187e9ed8
  5. 07 Jun, 2015 1 commit
    • Bram Schoenmakers's avatar
      Fix infinite loop with keep_sorted = 1. · 9d33afef
      Bram Schoenmakers authored
      When a subcommand finishes, _post_excecute() is called for sorting,
      archiving and writing the file. But sorting is also a subcommand, which
      in turn also calls _post_execute(), etc, etc.
      
      So let the caller of _execute() decide when to call _post_execute.
      
      This fixes issue #46.
      9d33afef
  6. 06 Jun, 2015 4 commits
    • Bram Schoenmakers's avatar
      Removed some unused stuff. · 1176abbf
      Bram Schoenmakers authored
      1176abbf
    • Bram Schoenmakers's avatar
      Don't let GrepFilter deal with integer expressions. · a021c148
      Bram Schoenmakers authored
      Just make sure that proper arguments are passed to GrepFilter in the
      first place.
      a021c148
    • Bram Schoenmakers's avatar
      Refactored the View class and Unicode support cleanups. · 09532f61
      Bram Schoenmakers authored
      This started as a refactoring of the View class: to get rid of the
      pretty_print() function and anything releated to printers. So the View
      class now solely focusses on sorting and viewing a bunch of todos. It's
      up to the users of the View class to retrieve the todos in the view and
      pass them on to a Printer instance.
      
      The View class was quite involved with the proper Unicode support that
      was added lately. There were still encoded string passed through this
      class rather than Unicode strings. Getting rid of this affected
      basically all other places in the codebase.
      
      The result is that there are less string conversions; printed todo items
      stay Unicode as long as possible, until they're actually written out to
      standard output or to a file. I got rid of one text_type() call from the
      six library, all @python_2_unicode_compatible decorators are gone and
      the tests no longer need the utf8() function because everything is
      Unicode now.
      
      Remove utf8 function.
      09532f61
    • Bram Schoenmakers's avatar
      34a5d7a4
  7. 04 Jun, 2015 3 commits
  8. 03 Jun, 2015 6 commits
  9. 02 Jun, 2015 3 commits
    • Jacek Sowiński's avatar
      Even safer base 16 colors · 0a860f45
      Jacek Sowiński authored
      - Colors specified by name will return safe ANSI codes.
      - Colors specified by number will return ANSI code from xterm 256 color
        chart.
      - Defaults are also *safe*.
      0a860f45
    • Bram Schoenmakers's avatar
      Some fixes regarding color sequences in todo items. · 8422217e
      Bram Schoenmakers authored
      This is a revert of commit fbed527f, which resulted in too many items
      after a project/context being highlighted.
      
      Instead, don't print a NEUTRAL_COLOR code at the end of the todo, but
      only when we finish applying all the color codes. This makes sure that
      the regexp to match a project/context also works at the end of a line.
      
      Also removed some logic to remove multiple sequences of NEUTRAL_COLOR at
      the end of the line, this is not necessary.
      8422217e
    • Jacek Sowiński's avatar
      Safer way to display base 16 colors · 877a6a7a
      Jacek Sowiński authored
      877a6a7a
  10. 01 Jun, 2015 6 commits
  11. 31 May, 2015 8 commits
    • Jacek Sowiński's avatar
      Fix context token in PrettyPrinterColorFilter · 17c29f55
      Jacek Sowiński authored
      + -> @
      17c29f55
    • Jacek Sowiński's avatar
      Add tests for colorscheme · f53aeef6
      Jacek Sowiński authored
      f53aeef6
    • Jacek Sowiński's avatar
      Add possibility to configure colorscheme of topydo · 44025480
      Jacek Sowiński authored
      - Add new module `topydo.lib.Colors` and class `Colors` for handling
        output colors and their ANSI codes.
      - Create new config options with colors for priorities, projects,
        contexts, metadata, and links and place them under "colorscheme"
        section. When certain config option is absent default color code will be
        applied.
      - Empty values:
          ! priority_colors will fall back to NEUTRAL_COLOR
          ! project_color, context_color, link_color, metadata_color will
            return empty string, so priority_color (if configured and applicable) of
            specific item should be used
      - Return NEUTRAL_COLOR if supplied color number is out range
      - Support user-friendly color names in config. At least for 16 base
        terminal colors.
      44025480
    • Bram Schoenmakers's avatar
    • Bram Schoenmakers's avatar
      Import the icalendar module on demand. · d941d514
      Bram Schoenmakers authored
      d941d514
    • Bram Schoenmakers's avatar
      Introduce `ls -f <format>` to specify the output format. · 1a75b94f
      Bram Schoenmakers authored
      Instead of creating a subcommand for every possible output format we're
      going to think of in the future, just let ListCommand handle the output
      format by connecting to the right format printer.
      
      In this commit, the 'ical' subcommand is deprecated, to be removed after
      the next release.
      
      The 'json' subcommand has been removed altogether, it existed for only a
      few hours.
      1a75b94f
    • Bram Schoenmakers's avatar
      847b2132
    • Bram Schoenmakers's avatar
      Prompt mode: reload the todo.txt file if it was modified. · 8eff0f0c
      Bram Schoenmakers authored
      The todo.txt file can be modified while the prompt is running. Make sure
      to reload the file when the mtime has changed since the previous load.
      
      This addresses the issue that changes after the 'edit' subcommand were
      not visible when returning to the topydo prompt (issue #33).
      
      Also, other changes done while the prompt is running will be picked up.
      
      A safety measure was taken to refuse executing a command when the
      todo.txt file was modified while the prompt was visible (i.e. the user
      was busy typing a command). By doing so, subcommands such as 'do' and
      'del' will only operate on the actual state of the todo.txt file, not
      some previous state still in memory.
      8eff0f0c