summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO6
-rw-r--r--002_sort_found_notes.patch64
-rw-r--r--PKGBUILD7
3 files changed, 66 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4d84487f05a3..f219b1829768 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,9 @@
# Generated by mksrcinfo v8
-# Thu Feb 2 09:26:10 UTC 2017
+# Wed Mar 1 15:36:36 UTC 2017
pkgbase = terminal_velocity-git
pkgdesc = A fast note-taking app for the UNIX terminal (patched)
pkgver = 0.1a7.r21.gbb2000b
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/vhp/terminal_velocity
arch = any
license = GPL
@@ -13,7 +13,7 @@ pkgbase = terminal_velocity-git
source = git://github.com/vhp/terminal_velocity.git
source = 002_sort_found_notes.patch
sha1sums = SKIP
- sha1sums = 426613e5620251c37854e489b21e4790c6c7df3b
+ sha1sums = fb82f0ce20b6b529292753f630d499d40ddcc14b
pkgname = terminal_velocity-git
diff --git a/002_sort_found_notes.patch b/002_sort_found_notes.patch
index 6053037b74d7..cc5858fc4994 100644
--- a/002_sort_found_notes.patch
+++ b/002_sort_found_notes.patch
@@ -1,11 +1,67 @@
---- a/urwid_ui.py 2016-03-14 02:56:30.348210225 +0100
-+++ b/urwid_ui.py 2016-03-14 02:56:38.421447101 +0100
-@@ -409,7 +409,7 @@
+diff --git a/bin/terminal_velocity b/bin/terminal_velocity
+index db2eb05..bb77dc6 100755
+--- a/bin/terminal_velocity
++++ b/bin/terminal_velocity
+@@ -75,6 +75,10 @@ the default default will be used"""
+ default=defaults.get("log_file", "~/.tvlog"),
+ help="the file to log to (default: %(default)s)")
+
++ parser.add_argument("-s", "--sort", dest="sort", action="store",
++ default=defaults.get("sort", "date"),
++ help="the note sorting rules. Possible values: date, title (default: %(default)s)")
++
+ parser.add_argument("-p", "--print-config", dest="print_config",
+ action="store_true", default=False,
+ help="print your configuration settings then exit")
+@@ -120,7 +124,7 @@ the default default will be used"""
+ try:
+ urwid_ui.launch(notes_dir=args.notes_dir, editor=args.editor,
+ extension=args.extension, extensions=args.extensions,
+- exclude=args.exclude)
++ exclude=args.exclude, sort=args.sort)
+ except KeyboardInterrupt:
+ # Silence KeyboardInterrupt tracebacks on ctrl-c.
+ sys.exit()
+diff --git a/terminal_velocity/urwid_ui.py b/terminal_velocity/urwid_ui.py
+index 34cf4f6..caebcb9 100644
+--- a/terminal_velocity/urwid_ui.py
++++ b/terminal_velocity/urwid_ui.py
+@@ -237,11 +237,12 @@ class NoteFilterListBox(urwid.ListBox):
+ class MainFrame(urwid.Frame):
+ """The topmost urwid widget."""
+
+- def __init__(self, notes_dir, editor, extension, extensions, exclude=None):
++ def __init__(self, notes_dir, editor, extension, extensions, exclude=None, sort="date"):
+
+ self.editor = editor
+ self.notebook = notebook.PlainTextNoteBook(notes_dir, extension,
+ extensions, exclude=exclude)
++ self.sort = sort
+
+ # Don't filter the note list when the text in the search box changes.
+ self.suppress_filter = False
+@@ -408,7 +409,10 @@ class MainFrame(urwid.Frame):
# Sort the notes.
# TODO: Support different sort orderings.
- matching_notes.sort(key=lambda x: x.mtime, reverse=True)
-+ matching_notes.sort(key=lambda x: x.title)
++ if self.sort == "title":
++ matching_notes.sort(key=lambda x: x.title)
++ else:
++ matching_notes.sort(key=lambda x: x.mtime, reverse=True)
# Tell the list box to show only the matching notes.
self.list_box.filter(matching_notes)
+@@ -433,10 +437,10 @@ class MainFrame(urwid.Frame):
+ self.selected_note = note
+
+
+-def launch(notes_dir, editor, extension, extensions, exclude=None):
++def launch(notes_dir, editor, extension, extensions, exclude=None, sort="date"):
+ """Launch the user interface."""
+
+- frame = MainFrame(notes_dir, editor, extension, extensions, exclude=exclude)
++ frame = MainFrame(notes_dir, editor, extension, extensions, exclude=exclude, sort=sort)
+ loop = urwid.MainLoop(frame, palette)
+ frame.loop = loop
+ loop.run()
diff --git a/PKGBUILD b/PKGBUILD
index 677371604378..0ba990e5b23a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
_pkgname=terminal_velocity
pkgname=terminal_velocity-git
pkgver=0.1a7.r21.gbb2000b
-pkgrel=1
+pkgrel=2
pkgdesc="A fast note-taking app for the UNIX terminal (patched)"
arch=('any')
url="https://github.com/vhp/terminal_velocity"
@@ -15,7 +15,7 @@ source=(
'002_sort_found_notes.patch'
)
sha1sums=('SKIP'
- '426613e5620251c37854e489b21e4790c6c7df3b')
+ 'fb82f0ce20b6b529292753f630d499d40ddcc14b')
pkgver() {
cd "$srcdir/$_pkgname"
@@ -23,9 +23,8 @@ pkgver() {
}
build() {
- cd "$srcdir/$_pkgname/$_pkgname"
- patch -p1 < ../../002_sort_found_notes.patch
cd "$srcdir/$_pkgname"
+ patch -p1 < ../../002_sort_found_notes.patch
python2 setup.py build
}