Beispiel #1
0
 for name in args:
     try:
         if name.endswith('.py'):
             path = name
             (name, _) = os.path.splitext(os.path.basename(name))
             modules.append(Interpreter.load_file(name, path, modpath))
         else:
             modules.append(Interpreter.load_module(name, modpath)[-1])
     except ModuleNotFound, e:
         print >> sys.stderr, 'module not found:', name
 if showall:
     modules = Interpreter.get_all_modules()
 if ErrorConfig.unfound_modules:
     print >> sys.stderr, 'modules not found:', ', '.join(
         sorted(ErrorConfig.unfound_modules))
 TypeNode.run(iteration=iteration)
 TypeChecker.check()
 MustBeDefinedNode.check()
 ExceptionCatcher.check()
 TypeNode.run(iteration=iteration)
 if verbose:
     print >> sys.stderr, (
         'total files=%d, lines=%d in %.2fsec' %
         (Interpreter.files, Interpreter.lines, time.time() - t))
 outfp = sys.stdout
 if output:
     outfp = file(output, 'w')
 strm = IndentedStream(outfp)
 if format == 'xml': strm.write('<output>')
 for module in modules:
     if format == 'xml':
Beispiel #2
0
 def __init__(self, exptobj, frame):
   self.exptobj = exptobj
   self.frame = frame
   TypeNode.__init__(self, [self])
   return
Beispiel #3
0
 modules = []
 for name in args:
   try:
     if name.endswith('.py'):
       path = name
       (name,_) = os.path.splitext(os.path.basename(name))
       modules.append(Interpreter.load_file(name, path, modpath))
     else:
       modules.append(Interpreter.load_module(name, modpath)[-1])
   except ModuleNotFound, e:
     print >>sys.stderr, 'module not found:', name
 if showall:
   modules = Interpreter.get_all_modules()
 if ErrorConfig.unfound_modules:
   print >>sys.stderr, 'modules not found:', ', '.join(sorted(ErrorConfig.unfound_modules))
 TypeNode.run(iteration=iteration)
 TypeChecker.check()
 MustBeDefinedNode.check()
 ExceptionCatcher.check()
 TypeNode.run(iteration=iteration)
 if verbose:
   print >>sys.stderr, ('total files=%d, lines=%d in %.2fsec' %
                        (Interpreter.files, Interpreter.lines, time.time()-t))
 outfp = sys.stdout
 if output:
   outfp = file(output, 'w')
 strm = IndentedStream(outfp)
 if format == 'xml': strm.write('<output>')
 for module in modules:
   if format == 'xml':
     module.showxml(strm)