From: Noel O'B. <bao...@gm...> - 2012-02-26 16:08:25
|
Great idea. I've always found it a pain also. Maybe put the code as a function in logfileparser.py. And then just call it with logfileparser.runmain(*argv). This will allow us to easily add functionality in future if necessary. - Noel On 25 February 2012 22:51, Adam Tenderholt <ate...@gm...> wrote: > Hi all, > > When testing recent changes to a parser, I've always wanted a way to just call 'python parser.py filename' to see if it works without resorting to another python script and/or installing and running ccget. I figured this could be handled in the main function, which I've modified for the gamessparser: > > -- > if __name__ == "__main__": > import doctest, gamessparser, sys > if len(sys.argv) == 1: > doctest.testmod(gamessparser, verbose=False) > > if len(sys.argv) >= 2: > parser = gamessparser.GAMESS(sys.argv[1]) > data = parser.parse() > > if len(sys.argv) > 2: > for i in range(len(sys.argv[2:])): > if hasattr(data, sys.argv[2 + i]): > print getattr(data, sys.argv[2 + i]) > -- > > Does this seem reasonable? Should it be added to the other parsers? > > Adam > > > > ------------------------------------------------------------------------------ > Virtualization & Cloud Management Using Capacity Planning > Cloud computing makes use of virtualization - but cloud computing > also focuses on allowing computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > cclib-devel mailing list > ccl...@li... > https://lists.sourceforge.net/lists/listinfo/cclib-devel |