File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import sys
2+ import os
13
24from test_parser import *
3- import sys , os
45
56os .chdir (os .path .split (os .path .abspath (__file__ ))[0 ])
67sys .path .insert (0 , os .path .abspath (os .path .join (os .pardir , "src" )))
7-
8-
98import parser
109
1110if __name__ == "__main__" :
12- x = ""
11+ p = parser . HTMLParser ()
1312 if len (sys .argv ) > 1 :
1413 x = sys .argv [1 ]
14+ if len (sys .argv ) > 2 :
15+ import hotshot
16+ import hotshot .stats
17+ prof = hotshot .Profile ('stats.prof' )
18+ prof .runcall (p .parse , x , False )
19+ prof .close ()
20+ stats = hotshot .stats .load ('stats.prof' )
21+ stats .strip_dirs ()
22+ stats .sort_stats ('time' )
23+ stats .print_stats ()
24+ else :
25+ document = p .parse (x )
26+ print convertTreeDump (document .printTree ())
1527 else :
16- x = "x"
17- p = parser .HTMLParser ()
18- document = p .parse (StringIO .StringIO (x ))
19- print convertTreeDump (document .printTree ())
28+ print """Pass one argument to parse the document and two to get an
29+ indication on what's going on.
30+ """
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments