示例#1
0
def test_mixlines( count=100 ) :
    while count :
        wikitext = mixedlines()
        try : wikitext.decode('utf-8')
        except : continue
        open( FILENAME, 'w' ).write( wikitext )
        etx_cmdline( FILENAME )
        count -= 1
示例#2
0
def main():
    options, args = _option_parse()

    if options.version:
        print tayra.__version__

    elif args and isfile(args[0]):
        eazytext.etx_cmdline(
            args[0],
            args=options.args,
            ofile=options.ofile,
            context=options.context,
            debuglevel=int(options.debug),
            show=options.show,
            dump=options.dump,
        )
示例#3
0
def test_stdfiles():
    for f in sorted(os.listdir(STDDIR)):
        filepath = join(STDDIR, f)
        if f.endswith('.etx'):
            print '%r ...' % f
            etx_cmdline(filepath, context=contexts.get(f, '{}'))
            print
    print
    print "Reference checking ... "
    for f in os.listdir(STDDIR):
        outfile = join(STDDIR, f)
        if f.startswith('.') or f.endswith('.etx') or isdir(outfile): continue
        reffile = join(STDREFDIR, f)
        refpytext = open(reffile).read()
        pytext = open(outfile).read()
        print "%25r : %s" % (basename(f), refpytext == pytext)
示例#4
0
def test_stdfiles() :
    for f in sorted( os.listdir( STDDIR )) :
        filepath = join( STDDIR, f )
        if f.endswith('.etx') :
            print '%r ...' % f
            etx_cmdline( filepath, context=contexts.get(f, '{}') )
            print
    print  
    print "Reference checking ... "
    for f in os.listdir( STDDIR ) :
        outfile = join( STDDIR, f )
        if f.startswith('.') or f.endswith( '.etx' ) or isdir(outfile) : continue
        reffile = join( STDREFDIR, f )
        refpytext = open(reffile).read()
        pytext = open(outfile).read()
        print "%25r : %s" % ( basename(f), refpytext==pytext)
示例#5
0
def main() :
    options, args = _option_parse()

    if options.version :
        print tayra.__version__

    elif args and isfile( args[0] ) :
        eazytext.etx_cmdline(
            args[0],
            args=options.args,
            ofile=options.ofile,
            context=options.context,
            debuglevel=int(options.debug),
            show=options.show,
            dump=options.dump,
        )