[Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/ncc/nesdoc-py archive.py, 1.4, 1.5 genhtml.py, 1.4, 1.5

David Gay idgay at users.sourceforge.net
Fri May 2 13:49:46 PDT 2008


Update of /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc/nesdoc-py
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv32217/tools/tinyos/ncc/nesdoc-py

Modified Files:
	archive.py genhtml.py 
Log Message:
-quiet option for nesdoc


Index: archive.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc/nesdoc-py/archive.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** archive.py	23 Aug 2007 20:26:46 -0000	1.4
--- archive.py	2 May 2008 20:49:44 -0000	1.5
***************
*** 55,59 ****
  
  def usage():
!   print "Usage: %s [-t dir] [--topdir dir] [--preserve] [--app] repository" % argv[0]
    print "  where -t/--topdir specify prefixes to remove from file names"
    print "  to create nice, package-like names for interface and components"
--- 55,59 ----
  
  def usage():
!   print "Usage: %s [-t dir] [--topdir dir] [--preserve] [--app] [--quiet] repository" % argv[0]
    print "  where -t/--topdir specify prefixes to remove from file names"
    print "  to create nice, package-like names for interface and components"
***************
*** 62,65 ****
--- 62,66 ----
    print "  If --app is specified, a page for this application is created in the"
    print "  current directory."
+   print "  If --quiet is specified, the program is less verbose."
    print "  The XML input is read from stdin."
  
***************
*** 104,111 ****
  
  # option processing. See usage string for details.
! (opts, args) = getopt(argv[1:], "t:", [ "topdir=", "preserve", "app" ])
! topopts = filter(lambda (x): x[0] != "--preserve" and x[0] != "--app", opts)
  preserve = filter(lambda(x): x[0] == "--preserve", opts) != []
  app = filter(lambda(x): x[0] == "--app", opts) != []
  topdirs = map(lambda (x): canonicalisedir(x[1]), topopts)
  if len(args) != 1:
--- 105,113 ----
  
  # 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:
***************
*** 216,220 ****
    if preserve and os.path.exists(filename):
      continue
!   # print "interface %s (%s)" % (name, nicename)
    doc = creator.createDocument(None, None, None)
    copy = x.cloneNode(True)
--- 218,223 ----
    if preserve and os.path.exists(filename):
      continue
!   if not quiet:
!     print "interface %s (%s)" % (name, nicename)
    doc = creator.createDocument(None, None, None)
    copy = x.cloneNode(True)
***************
*** 234,239 ****
      if preserve and os.path.exists(filename):
        continue
!     
!     # print "component %s (%s)" % (name, nicename)
      doc = creator.createDocument(None, None, None)
      # copy component and create its specification
--- 237,242 ----
      if preserve and os.path.exists(filename):
        continue
!     if not quiet:
!       print "component %s (%s)" % (name, nicename)
      doc = creator.createDocument(None, None, None)
      # copy component and create its specification

Index: genhtml.py
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc/nesdoc-py/genhtml.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** genhtml.py	23 Aug 2007 20:26:45 -0000	1.4
--- genhtml.py	2 May 2008 20:49:44 -0000	1.5
***************
*** 52,56 ****
  # Generate HTML files, and a global index for all interfaces and components
  # in the specified repository
! repository = argv[1]
  try:
    chdir(repository)
--- 52,62 ----
  # Generate HTML files, and a global index for all interfaces and components
  # in the specified repository
! if argv[1] == "--quiet":
!   repository = argv[2]
!   quiet = True
! else:
!   repository = argv[1]
!   quiet = False
! 
  try:
    chdir(repository)
***************
*** 76,80 ****
  for intf in intffiles:
    if search("\\.xml$", intf):
!     #stderr.write("interface " + intf + "\n")
      ixml = parse("interfaces/" + intf)
      generate_interface(ixml.documentElement)
--- 82,87 ----
  for intf in intffiles:
    if search("\\.xml$", intf):
!     if not quiet:
!       stderr.write("interface " + intf + "\n")
      ixml = parse("interfaces/" + intf)
      generate_interface(ixml.documentElement)
***************
*** 83,87 ****
  for comp in compfiles:
    if search("\\.xml$", comp):
!     #stderr.write("component " + comp + "\n")
      ixml = parse("components/" + comp)
      generate_component_graph(ixml.documentElement)
--- 90,95 ----
  for comp in compfiles:
    if search("\\.xml$", comp):
!     if not quiet:
!       stderr.write("component " + comp + "\n")
      ixml = parse("components/" + comp)
      generate_component_graph(ixml.documentElement)



More information about the Tinyos-2-commits mailing list