def main() : options, args = _option_parse() if options.version : print tss.__version__ elif args and isfile(args[0]) : ttlloc = args.pop(0) tss.tss_cmdline( ttlloc, _options=options ) elif int(options.debug) : TSSParser( tssconfig={}, debug=int(options.debug) )
def test_translate( tssloc, options ): kwargs = {} kwargs.update( plaincss=options.plaincss ) tss_cmdline( tssloc, **kwargs ) tsstext = codecs.open(tssloc, encoding='utf-8-sig',).read() cssfile = tssloc[:-4]+'.css' csstext = codecs.open(cssfile, encoding='utf-8-sig').read() rc = csstext == tsstext if options.rmonsuccess and rc : os.remove(tssloc) os.remove(tssloc+'.py') os.remove(cssfile) return rc