Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Commit

Permalink
added all option
Browse files Browse the repository at this point in the history
  • Loading branch information
Cliff Wells committed May 1, 2012
1 parent 39ddcb1 commit d4671b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions update_pages.py
Expand Up @@ -18,8 +18,9 @@
from optparse import OptionParser

parser = OptionParser ()
parser.set_defaults (cutoff=30)
parser.set_defaults (cutoff=30, all=False)
parser.add_option ("-c", "--cutoff", dest="cutoff", help="only process files newer than N minutes", metavar="MINUTES", type=int)
parser.add_option ("-a", "--all", action="store_true", dest="all", help="process all files", metavar="")
(options, args) = parser.parse_args ()

# assume that SVN is updated less than 30 minutes prior to now
Expand All @@ -36,7 +37,7 @@
# only files changed within last <cutoff> minutes
st = os.stat (os.path.join (root, filename))
mtime = datetime.fromtimestamp (st.st_mtime)
if mtime < cutoff:
if mtime < cutoff and not options.all:
continue

# convert filename to wiki page style
Expand Down

0 comments on commit d4671b4

Please sign in to comment.