#!/usr/bin/env python import pingphp import os import glob2 import logging os.chdir('./test') pingphp.run() files = glob2.glob('dest/test/**/*.php') from pingphp.helper import read for filePath in files: stdFilePath = 'std-' + filePath fileContent = read(filePath) fileContentStd = read(stdFilePath) if fileContent != fileContentStd: logging.error('Compare file: %s to %s not same\a', filePath, stdFilePath) exit(1) logging.info('Compare file: %s to %s same', filePath, stdFilePath)
#!/usr/bin/env python import sys from pingphp.helper import read from pingphp.lexer import PingLexer filename = './test/test/' if len(sys.argv)>1: filename += sys.argv[1] else: print('Please input filename!') exit(1) lexer = PingLexer(read(filename)) for item in lexer: print(item)
#!/usr/bin/env python import sys from pingphp.helper import read from pingphp.lexer import PingLexer filename = './test/test/' if len(sys.argv) > 1: filename += sys.argv[1] else: print('Please input filename!') exit(1) lexer = PingLexer(read(filename)) for item in lexer: print(item)