[Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/ncc/nesdoc-py archive.py, 1.6, 1.7
David Gay
idgay at users.sourceforge.net
Fri Sep 19 15:08:30 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc/nesdoc-py
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23440/nesdoc-py
Modified Files:
archive.py
Log Message:
minor cleanup/-topdir bug fix
Index: archive.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc/nesdoc-py/archive.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** archive.py 17 Jun 2008 19:02:03 -0000 1.6
--- archive.py 19 Sep 2008 22:08:28 -0000 1.7
***************
*** 71,75 ****
colon = index(loc, ":")
filename = canonicalise(loc[colon + 1:])
! for dir in topdirs:
dirlen = len(dir)
if filename[0:dirlen] == dir:
--- 71,75 ----
colon = index(loc, ":")
filename = canonicalise(loc[colon + 1:])
! for dir in topdir:
dirlen = len(dir)
if filename[0:dirlen] == dir:
***************
*** 105,116 ****
# option processing. See usage string for details.
! (opts, args) = getopt(argv[1:], "t:", [ "topdir=", "preserve", "app", "quiet" ])
! topopts = filter(lambda (x): x[0] != "--preserve" and x[0] != "--app" and x[0] != "--quiet", opts)
! preserve = filter(lambda(x): x[0] == "--preserve", opts) != []
! app = filter(lambda(x): x[0] == "--app", opts) != []
! quiet = filter(lambda(x): x[0] == "--quiet", opts) != []
! topdirs = map(lambda (x): canonicalisedir(x[1]), topopts)
if len(args) != 1:
usage()
repository = args[0]
--- 105,134 ----
# option processing. See usage string for details.
! def process_opts(argv):
! options = {
! "topdir": (True, lambda (x): topdir + [canonicalisedir(x)]),
! "preserve": (False, lambda x: True),
! "app": (False, lambda x: True),
! "quiet": (False, lambda x: True),
! }
! getopt_args = []
! for p in options:
! globals()[p] = False
! opt = p
! if options[p][0]:
! opt += "="
! getopt_args += [ opt ]
! (opts, args) = getopt(argv, "", getopt_args)
! topdir = []
! highlight = ""
! for o, a in opts:
! opt = o[2:]
! globals()[opt] = options[opt][1](a)
! return args
!
! args = process_opts(argv[1:])
if len(args) != 1:
usage()
+ exit(2)
repository = args[0]
More information about the Tinyos-2-commits
mailing list