本文整理汇总了Python中compressor.filters.base.CompilerFilter类的典型用法代码示例。如果您正苦于以下问题:Python CompilerFilter类的具体用法?Python CompilerFilter怎么用?Python CompilerFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CompilerFilter类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_precompiler_infile_with_spaces
def test_precompiler_infile_with_spaces(self):
self.setup_infile('static/css/filename with spaces.css')
command = '%s %s -f {infile} -o {outfile}' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(
content=self.content, filename=self.filename,
charset=settings.FILE_CHARSET, command=command)
self.assertEqual("body { color:#424242; }", compiler.input())
示例2: test_precompiler_stdin_stdout_filename
def test_precompiler_stdin_stdout_filename(self):
command = '%s %s' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(content=self.content, filename=self.filename, command=command)
self.assertEqual(u"body { color:#990; }\n", compiler.input())
示例3: test_precompiler_stdin_outfile
def test_precompiler_stdin_outfile(self):
command = '%s %s -o {outfile}' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(content=self.content, filename=None, command=command)
self.assertEqual(u"body { color:#990; }", compiler.input())
示例4: test_precompiler_infile_stdout
def test_precompiler_infile_stdout(self):
command = '%s %s -f {infile}' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(content=self.content, filename=None, command=command)
self.assertEqual(u"body { color:#990; }%s" % os.linesep, compiler.input())
示例5: test_precompiler_output_unicode
def test_precompiler_output_unicode(self):
command = '%s %s' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(content=self.content, filename=self.filename, command=command)
self.assertEqual(type(compiler.input()), six.text_type)
示例6: test_precompiler_stdin_stdout_filename
def test_precompiler_stdin_stdout_filename(self):
command = '%s %s' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(
content=self.content, filename=self.filename,
charset=settings.FILE_CHARSET, command=command)
self.assertEqual("body { color:#990; }%s" % os.linesep, compiler.input())
示例7: test_precompiler_infile_outfile
def test_precompiler_infile_outfile(self):
command = '%s %s -f {infile} -o {outfile}' % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(
content=self.content, filename=self.filename,
charset=settings.FILE_CHARSET, command=command)
self.assertEqual("body { color:#990; }", compiler.input())
示例8: test_precompiler_infile_outfile
def test_precompiler_infile_outfile(self):
command = "%s %s -f {infile} -o {outfile}" % (sys.executable, self.test_precompiler)
compiler = CompilerFilter(content=self.content, filename=self.filename, command=command)
self.assertEqual(u"body { color:#990; }", compiler.input())