Skip to content

Commit

Permalink
Merge branch 'paging'
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Kam committed Feb 19, 2008
2 parents 516708c + 34dbfd3 commit 0e33b11
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions todo.py
Expand Up @@ -108,6 +108,12 @@
import re, os, sys, time, getopt, sets, subprocess
from shutil import copyfile

# Guess the pager!
try:
PAGER = os.environ['PAGER']
except KeyError:
PAGER = 'less'

def usage():
text = "Usage: todo.py [options] [ACTION] [PARAM...] \n"
text += "Try `todo.py -h' for more information."
Expand Down Expand Up @@ -578,6 +584,7 @@ def list(patterns=None, userinput=True, showChildren=False, \
matchAny - switch, patterns are AND (False) or OR (True) matched
dates - list of date patterns for search OR matched
"""
sys.stdout = os.popen(PAGER,'w')
items = []
temp = {}
tasks = getTaskDict()
Expand Down Expand Up @@ -656,6 +663,7 @@ def removeDone(tasks):

def listKeywords():
"""Preliminary function to count keywords in todo and done files"""
sys.stdout = os.popen(PAGER,'w')
items = []
tasks = getTaskDict()
numTasks = len(tasks)
Expand Down

0 comments on commit 0e33b11

Please sign in to comment.