canto-curses.git
4 years agoRemove subthread locks
Jack Miller [Wed, 15 Jul 2015 07:23:21 +0000 (02:23 -0500)]
Remove subthread locks

These are generic in the daemon now.

4 years agoWait for written config changes to be processed
Jack Miller [Wed, 15 Jul 2015 07:15:34 +0000 (02:15 -0500)]
Wait for written config changes to be processed

4 years agoUse xdg-open as default browser
Jack Miller [Tue, 14 Jul 2015 19:40:01 +0000 (14:40 -0500)]
Use xdg-open as default browser

4 years agoAdd some useful settings to :help set
Jack Miller [Tue, 14 Jul 2015 17:26:59 +0000 (12:26 -0500)]
Add some useful settings to :help set

4 years agoRework tag_updater -> tagcore interaction
Jack Miller [Mon, 13 Jul 2015 17:11:08 +0000 (12:11 -0500)]
Rework tag_updater -> tagcore interaction

- ITEMS is now guaranteed to be a single response, so no need to buffer
  content waiting on ITEMSDONE (which is now issued, but ignored).

- The function uses a similar sorted-compare to sync() and the daemon's
  index(), which should make integrating new items take less time and
produce new/removed item hook calls directly.

- The Tagcore object itself has been stripped down.

- Tag_updater "reset" is now basically a no-op, it marks tags as reset,
  but doesn't actually clear their items. Then, "reset" tags are
automatically synchronized and re-sorted the next time items come in.
This saves quite a bit of time when refreshing.

- Tag_updater "update" now works in tandem with reset code, and merely
  sends out ITEMS requests directly.

4 years agoMore sync performance updates
Jack Miller [Mon, 13 Jul 2015 16:47:31 +0000 (11:47 -0500)]
More sync performance updates

This time, scrap it and derive everything from a sorted list comparison
O(nlogn) instead of O(n^2logn).

4 years agoSimplify tag_updater reset/update
Jack Miller [Sun, 12 Jul 2015 05:15:16 +0000 (00:15 -0500)]
Simplify tag_updater reset/update

4 years agoDon't drop parent_tag reference on die()
Jack Miller [Sun, 12 Jul 2015 03:34:20 +0000 (22:34 -0500)]
Don't drop parent_tag reference on die()

4 years agoBetter performance on sync()
Jack Miller [Sun, 12 Jul 2015 03:23:42 +0000 (22:23 -0500)]
Better performance on sync()

4 years agoBetter performance on next/prev tag
Jack Miller [Sun, 12 Jul 2015 02:36:34 +0000 (21:36 -0500)]
Better performance on next/prev tag

Don't need to be checking membership in a tag for every single item now
that we know this off hand.

4 years agoFix first tag items being improperly enumerated
Jack Miller [Wed, 8 Jul 2015 17:32:06 +0000 (12:32 -0500)]
Fix first tag items being improperly enumerated

4 years agoAdd cleantitle to manpage
Jack Miller [Wed, 8 Jul 2015 17:30:08 +0000 (12:30 -0500)]
Add cleantitle to manpage

4 years agocleantitle.py: option to forcibly remove anything that looks like HTML
Jack Miller [Wed, 8 Jul 2015 17:05:09 +0000 (12:05 -0500)]
cleantitle.py: option to forcibly remove anything that looks like HTML

4 years agoAdd cleantitle plugin + Story support
Jack Miller [Wed, 8 Jul 2015 16:50:00 +0000 (11:50 -0500)]
Add cleantitle plugin + Story support

This plugin adds the ability to do simple text replacement on story
titles before they're displayed. Useful for stripping out content that
(according to the feed) should be there, but (according to the user) is
crap. Default case, newlines and some HTML tags that seem to get left
behind occasionally.

4 years agoFix :help commands
Jack Miller [Thu, 25 Jun 2015 17:14:06 +0000 (12:14 -0500)]
Fix :help commands

4 years agoUpdate manpage with XDG paths
Jack Miller [Wed, 24 Jun 2015 21:17:02 +0000 (16:17 -0500)]
Update manpage with XDG paths

4 years agoFix hidden selection on :del
Jack Miller [Tue, 23 Jun 2015 19:59:20 +0000 (14:59 -0500)]
Fix hidden selection on :del

For now, just unset the selection (similar to the initial state). May
want to scroll back/forward to get the nearest selection, but for now
just not being offscreen is okay.

4 years agoRemove config compare from test-screen
Jack Miller [Tue, 23 Jun 2015 18:48:21 +0000 (13:48 -0500)]
Remove config compare from test-screen

With the new color system we expect this config to be fully loaded with
settings. It should be enough just to see that the setting is honored,
instead of rotely checking the colors are identical.

4 years agoUpdate test-screen for unmangled tagorder
Jack Miller [Tue, 23 Jun 2015 18:45:20 +0000 (13:45 -0500)]
Update test-screen for unmangled tagorder

Instead of items in Tag(2), we properly get items in Tag(0), so all of
the checks should expect that now.

4 years agoFix tag order getting mangled on new tags
Jack Miller [Tue, 23 Jun 2015 18:42:44 +0000 (13:42 -0500)]
Fix tag order getting mangled on new tags

4 years agoFix test-screen Gui initialization
Jack Miller [Tue, 23 Jun 2015 18:10:17 +0000 (13:10 -0500)]
Fix test-screen Gui initialization

Takes a GraphicalLog object now and tagupdater init is done after Gui is
instantiated.

4 years agoFix test-tagcore-function for new init
Jack Miller [Tue, 23 Jun 2015 18:07:17 +0000 (13:07 -0500)]
Fix test-tagcore-function for new init

We get hooks called on initial tagcores now.

4 years agoMake sure we setup a watch for new tags
Jack Miller [Sat, 20 Jun 2015 20:58:53 +0000 (15:58 -0500)]
Make sure we setup a watch for new tags

4 years agoFix exception on :del
Jack Miller [Fri, 19 Jun 2015 16:47:38 +0000 (11:47 -0500)]
Fix exception on :del

4 years agoFix accepting -1 as a valid color (default)
Jack Miller [Thu, 18 Jun 2015 14:36:50 +0000 (09:36 -0500)]
Fix accepting -1 as a valid color (default)

4 years agoFix :show-category
Jack Miller [Tue, 16 Jun 2015 04:08:31 +0000 (23:08 -0500)]
Fix :show-category

4 years agoMinor tag hook fix
Jack Miller [Tue, 16 Jun 2015 02:37:12 +0000 (21:37 -0500)]
Minor tag hook fix

4 years agoOnly sync single tags at a time
Jack Miller [Tue, 16 Jun 2015 02:36:23 +0000 (21:36 -0500)]
Only sync single tags at a time

Does well decreasing startup time and being more responsive when items
are turning over quickly (i.e. full refetch).

4 years agoprot_tagchange handles sending ITEMS, no need for update
Jack Miller [Tue, 16 Jun 2015 00:38:03 +0000 (19:38 -0500)]
prot_tagchange handles sending ITEMS, no need for update

4 years agoDo less on init, allow events to drive
Jack Miller [Tue, 16 Jun 2015 00:02:07 +0000 (19:02 -0500)]
Do less on init, allow events to drive

4 years agoAllow "default" to be passed to :color
Jack Miller [Sat, 13 Jun 2015 20:30:21 +0000 (15:30 -0500)]
Allow "default" to be passed to :color

4 years agoAdd color/style reset option to theme-default
Jack Miller [Sat, 13 Jun 2015 20:11:24 +0000 (15:11 -0500)]
Add color/style reset option to theme-default

4 years agoLet :reset-config take a top-level section argument
Jack Miller [Sat, 13 Jun 2015 20:04:03 +0000 (15:04 -0500)]
Let :reset-config take a top-level section argument

So `:reset-config color` or or `:reset-config style` will work without
interfering with the rest of the config.

4 years agoAdd config_version to template config
Jack Miller [Sat, 13 Jun 2015 19:51:04 +0000 (14:51 -0500)]
Add config_version to template config

Keeps :reset-config from confusing everything.

4 years agoInclude default tag theme in theme-default.py
Jack Miller [Sat, 13 Jun 2015 19:30:37 +0000 (14:30 -0500)]
Include default tag theme in theme-default.py

4 years agoAdd theme-default plugin
Jack Miller [Sat, 13 Jun 2015 19:22:12 +0000 (14:22 -0500)]
Add theme-default plugin

Show a basic plugin implementing the canto default theme.

Needs to be expanded to include colors, tags, and possibly the reader.

4 years agoReorder story theme colors
Jack Miller [Sat, 13 Jun 2015 18:57:14 +0000 (13:57 -0500)]
Reorder story theme colors

This prioritizes the addition of color codes so that more specific
information overrides less specific information.

For example, "selected" is now enabled after "unread" so that ":color
selected white" will turn the single selection white instead of having
that color overridden by the unread color which is far more general.

4 years agoDon't warn on command validation with obvious fallback
Jack Miller [Thu, 11 Jun 2015 02:26:01 +0000 (21:26 -0500)]
Don't warn on command validation with obvious fallback

4 years agoDisplay early log errors/warns graphically
Jack Miller [Thu, 11 Jun 2015 02:03:42 +0000 (21:03 -0500)]
Display early log errors/warns graphically

Instantiate the GraphicalLog object much earlier, so it can defer any
WARN/ERROR level logging. This allows stuff like config errors or
migration warnings to be displayed in the client instead of just in the
log.

4 years agoFix :help command completion
Jack Miller [Tue, 9 Jun 2015 18:12:07 +0000 (13:12 -0500)]
Fix :help command completion

4 years agoMinor fix for :style help output
Jack Miller [Tue, 9 Jun 2015 17:33:32 +0000 (12:33 -0500)]
Minor fix for :style help output

- First line should be suitable for including in :help commands

4 years agoAdd :style command
Jack Miller [Tue, 9 Jun 2015 17:28:22 +0000 (12:28 -0500)]
Add :style command

Allow easy manipulation of curses styles (normal, bold, reverse,
standout, underline).

4 years agoFix color manager with long code colors
Jack Miller [Sun, 7 Jun 2015 16:48:22 +0000 (11:48 -0500)]
Fix color manager with long code colors

4 years agoAdd check_program to curses plugins
Jack Miller [Sat, 6 Jun 2015 19:22:25 +0000 (14:22 -0500)]
Add check_program to curses plugins

4 years agoAdd config migration
Jack Miller [Fri, 5 Jun 2015 18:01:08 +0000 (13:01 -0500)]
Add config migration

- With initial case for new color system

4 years agoFixup so old parser imports
Jack Miller [Fri, 5 Jun 2015 17:52:56 +0000 (12:52 -0500)]
Fixup so old parser imports

4 years agoMake :color work with symbolic color, improve help text
Jack Miller [Fri, 5 Jun 2015 01:58:54 +0000 (20:58 -0500)]
Make :color work with symbolic color, improve help text

4 years agoMass conversion to better log.debug use
Jack Miller [Fri, 5 Jun 2015 00:51:32 +0000 (19:51 -0500)]
Mass conversion to better log.debug use

Pass the format arguments to log.debug so we avoid the CPU hit
formatting strings we won't use.

4 years agoConvert to symbolic colors
Jack Miller [Thu, 4 Jun 2015 03:10:02 +0000 (22:10 -0500)]
Convert to symbolic colors

Use color "unread", for example, instead of embedding a color code
directly. This gives finer grain control.

4 years agoChange color validator to do whole block
Jack Miller [Thu, 4 Jun 2015 02:12:20 +0000 (21:12 -0500)]
Change color validator to do whole block

4 years agoRemove theme attr_debug
Jack Miller [Wed, 3 Jun 2015 21:30:14 +0000 (16:30 -0500)]
Remove theme attr_debug

4 years agoRemove theme parser
Jack Miller [Wed, 3 Jun 2015 21:23:32 +0000 (16:23 -0500)]
Remove theme parser

This is far better done in Python with plugins instead of a clusterfuck
of escapes and shite.

4 years agoCleanup command.py
Jack Miller [Mon, 1 Jun 2015 17:25:56 +0000 (12:25 -0500)]
Cleanup command.py

Stop using arbitrary references into tuples, in favor of actually having
an object with named variables.

4 years agoMake j/k scrolling work in generic info box (:help)
Jack Miller [Mon, 1 Jun 2015 16:44:45 +0000 (11:44 -0500)]
Make j/k scrolling work in generic info box (:help)

4 years agoMake tab completion behave more like bash
Jack Miller [Mon, 1 Jun 2015 16:27:49 +0000 (11:27 -0500)]
Make tab completion behave more like bash

In terms of cursor position, and behavior when you start doing stuff
other than hitting tab.

4 years agoAdd "quiet" variable to shutup graphical log output
Jack Miller [Wed, 20 May 2015 22:06:36 +0000 (17:06 -0500)]
Add "quiet" variable to shutup graphical log output

- Update autocmd plugin to use it as well.

4 years agoMerge pull request #23 from dkasak/master
Jack Miller [Sun, 17 May 2015 20:09:52 +0000 (15:09 -0500)]
Merge pull request #23 from dkasak/master

yank.py: Fix problems with yanking shell metacharacters.

4 years agoyank.py: Fix problems with yanking shell metacharacters.
Denis Kasak [Tue, 12 May 2015 19:50:28 +0000 (21:50 +0200)]
yank.py: Fix problems with yanking shell metacharacters.

Switch to using the subprocess module instead of going through the shell
(via system()) since the latter is problematic if the string to be
yanked contains shell metacharacters.

4 years ago0.9.3 v0.9.3
Jack Miller [Tue, 7 Apr 2015 13:55:57 +0000 (08:55 -0500)]
0.9.3

4 years agoSimplify use of extra_lines
Jack Miller [Wed, 25 Mar 2015 00:12:56 +0000 (19:12 -0500)]
Simplify use of extra_lines

Fixes borders not appearing at the end of a full screen

4 years agoUnhide "color" command
Jack Miller [Tue, 24 Mar 2015 23:41:50 +0000 (18:41 -0500)]
Unhide "color" command

4 years ago%C escape suspends colors as well as attributes
Jack Miller [Tue, 24 Mar 2015 20:10:45 +0000 (15:10 -0500)]
%C escape suspends colors as well as attributes

4 years agoFix butchering 0 width space characters (\n)
Jack Miller [Mon, 23 Mar 2015 22:27:10 +0000 (17:27 -0500)]
Fix butchering 0 width space characters (\n)

Introduced in last commit.

4 years agoBetter handling of invalid multi-byte sequences
Jack Miller [Tue, 17 Mar 2015 20:25:15 +0000 (15:25 -0500)]
Better handling of invalid multi-byte sequences

Occasionally, feed data has some weird multi-bytes sequences that both
mbtowc and mbstowcs don't like. It looks like browsers handle them okay,
but I haven't found a single command line program (not even vim) that
can handle them well so for now just skip over anything for which mbtowc
returns -1 for.

4 years agoFiner grain defaults.* change reporting
Jack Miller [Tue, 17 Mar 2015 16:41:12 +0000 (11:41 -0500)]
Finer grain defaults.* change reporting

4 years agoEnsure strtags has no duplicates, even pre-init
Jack Miller [Tue, 17 Mar 2015 16:37:03 +0000 (11:37 -0500)]
Ensure strtags has no duplicates, even pre-init

If we get more than one NEWTAG pre-init, we weren't checking if we'd
already recorded it in strtags.

4 years ago0.9.2 v0.9.2
Jack Miller [Wed, 4 Feb 2015 22:18:06 +0000 (16:18 -0600)]
0.9.2

4 years agoBetter version of previous commit
Jack Miller [Fri, 30 Jan 2015 22:33:31 +0000 (16:33 -0600)]
Better version of previous commit

- Sub this is on newitems instead of converting redraw into a full loop.

4 years agoStub in curpos for offscreen items
Jack Miller [Fri, 30 Jan 2015 22:07:41 +0000 (16:07 -0600)]
Stub in curpos for offscreen items

This should quash the curpos exceptions, and possibly a hard lock
related to them. Stub them in as self.height, which is short hand for
"off screen down" as it should cause a scroll.

Calculating the actual value would cause the redraw function to scale
linearly with number of items instead of (the much smaller and usually
constant) value of the screen size.

4 years ago0.9.1 v0.9.1
Jack Miller [Fri, 9 Jan 2015 21:09:17 +0000 (15:09 -0600)]
0.9.1

4 years agoDon't count items already in interface as pending updates
Jack Miller [Fri, 9 Jan 2015 22:17:01 +0000 (16:17 -0600)]
Don't count items already in interface as pending updates

The data has made a round trip, but this makes the grey update indicator
into an pending new item count instead of something more nebulous.

4 years agoMake tag-list defaults include first_sel
Jack Miller [Wed, 17 Dec 2014 19:06:05 +0000 (13:06 -0600)]
Make tag-list defaults include first_sel

Similar to item-list, tag-list operations should assume the first
visible tag, if there's no selection to base it on.

4 years agoStop locking on variable changes
Jack Miller [Fri, 9 Jan 2015 15:51:17 +0000 (09:51 -0600)]
Stop locking on variable changes

- var_lock was merged with config_lock to avoid having a million
deadlock cases

- locking on vars now really hampers performance

- most vars are accessed by only a single thread (i.e. used as
  out-of-instance storage for classes that need to resize, which would
only be handled by the gui) so the locking for these is totally
unnecessary

- vars that are accessed by multiple threads are probably already
  serialized by sync lock (i.e. input thread holds sync while it
performs a command that changes selection, gui thread holds sync while
the Taglist uses that selection info).

- the GIL prevents any C-like sort of half-way splinched assignment

- config_lock could probably be done away with entirely at this point,
  but I'm more concerned that there could be a reason to do an atomic
change to multiple variables at some point.

I'm taking a wait and see approach on this. The ultimate test for
whether a lock is unnecessary is removing the lock =P.

4 years agoUpdate error box color
Jack Miller [Wed, 17 Dec 2014 18:54:50 +0000 (12:54 -0600)]
Update error box color

4 years agoAdd selection preservation test
Jack Miller [Wed, 17 Dec 2014 18:53:30 +0000 (12:53 -0600)]
Add selection preservation test

- Make sure that selections that disappear from the tagcore remain in
  the tag

- Make sure they are then eliminated when no longer selected and an
  update occurs

4 years agoToss undead former selections faster
Jack Miller [Wed, 17 Dec 2014 18:49:37 +0000 (12:49 -0600)]
Toss undead former selections faster

When preserving the selection, we keep items in the graphical Tag that
are no longer in the TagCore. That's fine, but we need to re-evaluate
that tag next time a sync is requested, despite the fact that the
underlying TagCore may not have changed.

This should make formerly selected items disappear faster.

4 years agoSet working flag earlier
Jack Miller [Tue, 16 Dec 2014 03:18:04 +0000 (21:18 -0600)]
Set working flag earlier

We want to be able to use it with sync_requested to determine if the gui
thread is in progress, so close the window where they're both false.

4 years agoTagcore script should include PING -> PONG
Jack Miller [Tue, 16 Dec 2014 01:58:39 +0000 (19:58 -0600)]
Tagcore script should include PING -> PONG

On refresh, it uses this to know when the old responses have stopped
coming in.

4 years agoFix missing import on exception
Jack Miller [Fri, 12 Dec 2014 02:53:24 +0000 (20:53 -0600)]
Fix missing import on exception

4 years agoMake summarize + collapse tests functional
Jack Miller [Sat, 29 Nov 2014 17:11:55 +0000 (11:11 -0600)]
Make summarize + collapse tests functional

4 years agoUpdate test wait to use gui.working
Jack Miller [Sat, 29 Nov 2014 02:39:00 +0000 (20:39 -0600)]
Update test wait to use gui.working

4 years agoAdd gui.working for testing
Jack Miller [Sat, 29 Nov 2014 02:37:08 +0000 (20:37 -0600)]
Add gui.working for testing

Instead of waiting for needs_refresh et. al. to be cleared, wait on that
and gui.working to make sure that it's actually done. This allows us to
wait until all of the refresh/redrawing is done, but still clear the
needs_* conditions before we run them (which allows them to indirectly
queue up another pass if necessary).

4 years agoMake curses tests output log to stdout
Jack Miller [Sat, 29 Nov 2014 02:03:32 +0000 (20:03 -0600)]
Make curses tests output log to stdout

4 years agoMinor taglist in tags -> is_tag change
Jack Miller [Sat, 29 Nov 2014 02:03:00 +0000 (20:03 -0600)]
Minor taglist in tags -> is_tag change

4 years agoModify "marked" style
Jack Miller [Thu, 27 Nov 2014 19:49:17 +0000 (13:49 -0600)]
Modify "marked" style

4 years agoDon't throw exception on improper theme %0
Jack Miller [Thu, 27 Nov 2014 19:39:54 +0000 (13:39 -0600)]
Don't throw exception on improper theme %0

4 years agoStop locking on WINCH
Jack Miller [Wed, 26 Nov 2014 07:18:27 +0000 (01:18 -0600)]
Stop locking on WINCH

4 years agoReorganize test-screen
Jack Miller [Wed, 26 Nov 2014 04:22:49 +0000 (22:22 -0600)]
Reorganize test-screen

- Push startup into __init__ with some basic sanity testing
- Add some taglist checks
- Move individual command post-condition tests into functions

4 years agoMore screen init tweaks
Jack Miller [Wed, 26 Nov 2014 04:12:00 +0000 (22:12 -0600)]
More screen init tweaks

This is for testing, mostly. Most of the time, the updates are triggered
by items that are arriving over time, but in a test environment with
rigid timing constraints and items pre-loaded, there are no subsequent
events to cause a refresh.

4 years agoTheme + color fixes and tweaks
Jack Miller [Tue, 25 Nov 2014 22:20:13 +0000 (16:20 -0600)]
Theme + color fixes and tweaks

- If you have customized your format strings, you needs to subtract one
  from all color codes (i.e. %3 should now be %2). %1 should now be
erased as well as the default color pair is always applied.

- attron won't overwrite a color if given color_pair(0), so attroff
  needs to be called explicitly on color changes.

4 years agoStrip more selection maintaining logic
Jack Miller [Tue, 25 Nov 2014 22:17:49 +0000 (16:17 -0600)]
Strip more selection maintaining logic

- Was causing the gui loop to never terminate because every refresh was
  setting and unsetting the selection trying to maintain.

4 years agoExpand screen test to test :color
Jack Miller [Tue, 25 Nov 2014 05:29:30 +0000 (23:29 -0600)]
Expand screen test to test :color

4 years agoFix bad pair referencing in fake_curses
Jack Miller [Tue, 25 Nov 2014 04:54:24 +0000 (22:54 -0600)]
Fix bad pair referencing in fake_curses

4 years agoRecord output of TestBackends
Jack Miller [Tue, 25 Nov 2014 04:29:55 +0000 (22:29 -0600)]
Record output of TestBackends

4 years agoLoop gui_thread until no re(draw/fresh/size)s required
Jack Miller [Tue, 25 Nov 2014 04:28:51 +0000 (22:28 -0600)]
Loop gui_thread until no re(draw/fresh/size)s required

4 years agoAdd indicator of pending updates to tag header
Jack Miller [Tue, 25 Nov 2014 03:45:54 +0000 (21:45 -0600)]
Add indicator of pending updates to tag header

4 years agoTrack attributes in fake_curses
Jack Miller [Tue, 25 Nov 2014 03:43:55 +0000 (21:43 -0600)]
Track attributes in fake_curses

4 years agoBasic overall testing environment
Jack Miller [Mon, 24 Nov 2014 08:41:13 +0000 (02:41 -0600)]
Basic overall testing environment

- A replacement main.py that overrides curses and friends to provide a
  print friendly, easily reproducible daemon-less test environment.

4 years agoAdd ability to generate stub item scripts
Jack Miller [Mon, 24 Nov 2014 05:13:22 +0000 (23:13 -0600)]
Add ability to generate stub item scripts

4 years agoAllow scripts to specify multiple responses
Jack Miller [Mon, 24 Nov 2014 03:32:36 +0000 (21:32 -0600)]
Allow scripts to specify multiple responses

- Useful for ITEMS, the responses to which are ITEMS, ITEMSDONE, and
  usually an automatic ATTRIBUTES response.