Linux worldls-302.fr.planethoster.net 4.18.0-553.8.1.lve.el7h.x86_64 #1 SMP Thu Jul 4 15:19:33 UTC 2024 x86_64
LiteSpeed
Server IP : 10.185.0.203 & Your IP : 216.73.217.14
Domains :
Cant Read [ /etc/named.conf ]
User : gerathty
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib64 /
python2.7 /
site-packages /
Cheetah /
Tests /
Delete
Unzip
Name
Size
Permission
Date
Action
Analyzer.py
604
B
-rw-r--r--
2014-01-10 04:44
Analyzer.pyc
1.21
KB
-rw-r--r--
2014-01-10 04:44
Analyzer.pyo
1.21
KB
-rw-r--r--
2014-01-10 04:44
CheetahWrapper.py
18.71
KB
-rw-r--r--
2014-01-10 04:44
CheetahWrapper.pyc
29.16
KB
-rw-r--r--
2014-01-10 04:44
CheetahWrapper.pyo
29.16
KB
-rw-r--r--
2014-01-10 04:44
Cheps.py
1.03
KB
-rw-r--r--
2014-01-10 04:44
Cheps.pyc
1.76
KB
-rw-r--r--
2014-01-10 04:44
Cheps.pyo
1.71
KB
-rw-r--r--
2014-01-10 04:44
Filters.py
1.94
KB
-rw-r--r--
2014-01-10 04:44
Filters.pyc
2.74
KB
-rw-r--r--
2014-01-10 04:44
Filters.pyo
2.57
KB
-rw-r--r--
2014-01-10 04:44
Misc.py
493
B
-rw-r--r--
2014-01-10 04:44
Misc.pyc
1.03
KB
-rw-r--r--
2014-01-10 04:44
Misc.pyo
1.03
KB
-rw-r--r--
2014-01-10 04:44
NameMapper.py
14.62
KB
-rw-r--r--
2014-01-10 04:44
NameMapper.pyc
26.95
KB
-rw-r--r--
2014-01-10 04:44
NameMapper.pyo
26.4
KB
-rw-r--r--
2014-01-10 04:44
Parser.py
1.2
KB
-rw-r--r--
2014-01-10 04:44
Parser.pyc
2.07
KB
-rw-r--r--
2014-01-10 04:44
Parser.pyo
2.07
KB
-rw-r--r--
2014-01-10 04:44
Performance.py
7.15
KB
-rw-r--r--
2014-01-10 04:44
Performance.pyc
9.37
KB
-rw-r--r--
2014-01-10 04:44
Performance.pyo
9.35
KB
-rw-r--r--
2014-01-10 04:44
Regressions.py
8.18
KB
-rw-r--r--
2014-01-10 04:44
Regressions.pyc
9.29
KB
-rw-r--r--
2014-01-10 04:44
Regressions.pyo
8.64
KB
-rw-r--r--
2014-01-10 04:44
SyntaxAndOutput.py
91.28
KB
-rw-r--r--
2014-01-10 04:44
SyntaxAndOutput.pyc
142.79
KB
-rw-r--r--
2014-01-10 04:44
SyntaxAndOutput.pyo
142.38
KB
-rw-r--r--
2014-01-10 04:44
Template.py
12.15
KB
-rw-r--r--
2014-01-10 04:44
Template.pyc
14.54
KB
-rw-r--r--
2014-01-10 04:44
Template.pyo
12.81
KB
-rw-r--r--
2014-01-10 04:44
Test.py
1.48
KB
-rw-r--r--
2014-01-10 04:44
Test.pyc
1.55
KB
-rw-r--r--
2014-01-10 04:44
Test.pyo
1.55
KB
-rw-r--r--
2014-01-10 04:44
Unicode.py
7.13
KB
-rw-r--r--
2014-01-10 04:44
Unicode.pyc
10.78
KB
-rw-r--r--
2014-01-10 04:44
Unicode.pyo
10.12
KB
-rw-r--r--
2014-01-10 04:44
__init__.py
2
B
-rw-r--r--
2014-01-10 04:44
__init__.pyc
147
B
-rw-r--r--
2014-01-10 04:44
__init__.pyo
147
B
-rw-r--r--
2014-01-10 04:44
xmlrunner.py
12.42
KB
-rw-r--r--
2014-01-10 04:44
xmlrunner.pyc
17.48
KB
-rw-r--r--
2014-01-10 04:44
xmlrunner.pyo
17.48
KB
-rw-r--r--
2014-01-10 04:44
Save
Rename
# -*- encoding: utf8 -*- from Cheetah.Template import Template from Cheetah import CheetahWrapper from Cheetah import DummyTransaction import imp import os import sys import tempfile import unittest class CommandLineTest(unittest.TestCase): def createAndCompile(self, source): sourcefile = '-' while sourcefile.find('-') != -1: sourcefile = tempfile.mktemp() fd = open('%s.tmpl' % sourcefile, 'w') fd.write(source) fd.close() wrap = CheetahWrapper.CheetahWrapper() wrap.main(['cheetah', 'compile', '--quiet', '--nobackup', sourcefile]) module_path, module_name = os.path.split(sourcefile) module = loadModule(module_name, [module_path]) template = getattr(module, module_name) return template class JBQ_UTF8_Test1(unittest.TestCase): def runTest(self): t = Template.compile(source="""Main file with |$v| $other""") otherT = Template.compile(source="Other template with |$v|") other = otherT() t.other = other t.v = u'Unicode String' t.other.v = u'Unicode String' assert unicode(t()) class JBQ_UTF8_Test2(unittest.TestCase): def runTest(self): t = Template.compile(source="""Main file with |$v| $other""") otherT = Template.compile(source="Other template with |$v|") other = otherT() t.other = other t.v = u'Unicode String with eacute é' t.other.v = u'Unicode String' assert unicode(t()) class JBQ_UTF8_Test3(unittest.TestCase): def runTest(self): t = Template.compile(source="""Main file with |$v| $other""") otherT = Template.compile(source="Other template with |$v|") other = otherT() t.other = other t.v = u'Unicode String with eacute é' t.other.v = u'Unicode String and an eacute é' assert unicode(t()) class JBQ_UTF8_Test4(unittest.TestCase): def runTest(self): t = Template.compile(source="""#encoding utf-8 Main file with |$v| and eacute in the template é""") t.v = 'Unicode String' assert unicode(t()) class JBQ_UTF8_Test5(unittest.TestCase): def runTest(self): t = Template.compile(source="""#encoding utf-8 Main file with |$v| and eacute in the template é""") t.v = u'Unicode String' assert unicode(t()) def loadModule(moduleName, path=None): if path: assert isinstance(path, list) try: mod = sys.modules[moduleName] except KeyError: fp = None try: fp, pathname, description = imp.find_module(moduleName, path) mod = imp.load_module(moduleName, fp, pathname, description) finally: if fp: fp.close() return mod class JBQ_UTF8_Test6(unittest.TestCase): def runTest(self): source = """#encoding utf-8 #set $someUnicodeString = u"Bébé" Main file with |$v| and eacute in the template é""" t = Template.compile(source=source) t.v = u'Unicode String' assert unicode(t()) class JBQ_UTF8_Test7(CommandLineTest): def runTest(self): source = """#encoding utf-8 #set $someUnicodeString = u"Bébé" Main file with |$v| and eacute in the template é""" template = self.createAndCompile(source) template.v = u'Unicode String' assert unicode(template()) class JBQ_UTF8_Test8(CommandLineTest): def testStaticCompile(self): source = """#encoding utf-8 #set $someUnicodeString = u"Bébé" $someUnicodeString""" template = self.createAndCompile(source)() a = unicode(template).encode("utf-8") self.assertEquals("Bébé", a) def testDynamicCompile(self): source = """#encoding utf-8 #set $someUnicodeString = u"Bébé" $someUnicodeString""" template = Template(source = source) a = unicode(template).encode("utf-8") self.assertEquals("Bébé", a) class EncodeUnicodeCompatTest(unittest.TestCase): """ Taken initially from Red Hat's bugzilla #529332 https://bugzilla.redhat.com/show_bug.cgi?id=529332 """ def runTest(self): t = Template("""Foo ${var}""", filter='EncodeUnicode') t.var = u"Text with some non-ascii characters: åäö" rc = t.respond() assert isinstance(rc, unicode), ('Template.respond() should return unicode', rc) rc = str(t) assert isinstance(rc, str), ('Template.__str__() should return a UTF-8 encoded string', rc) class Unicode_in_SearchList_Test(CommandLineTest): def test_BasicASCII(self): source = '''This is $adjective''' template = self.createAndCompile(source) assert template and issubclass(template, Template) template = template(searchList=[{'adjective' : u'neat'}]) assert template.respond() def test_Thai(self): # The string is something in Thai source = '''This is $foo $adjective''' template = self.createAndCompile(source) assert template and issubclass(template, Template) template = template(searchList=[{'foo' : 'bar', 'adjective' : u'\u0e22\u0e34\u0e19\u0e14\u0e35\u0e15\u0e49\u0e2d\u0e19\u0e23\u0e31\u0e1a'}]) assert template.respond() def test_Thai_utf8(self): utf8 = '\xe0\xb8\xa2\xe0\xb8\xb4\xe0\xb8\x99\xe0\xb8\x94\xe0\xb8\xb5\xe0\xb8\x95\xe0\xb9\x89\xe0\xb8\xad\xe0\xb8\x99\xe0\xb8\xa3\xe0\xb8\xb1\xe0\xb8\x9a' source = '''This is $adjective''' template = self.createAndCompile(source) assert template and issubclass(template, Template) template = template(searchList=[{'adjective' : utf8}]) assert template.respond() class InlineSpanishTest(unittest.TestCase): def setUp(self): super(InlineSpanishTest, self).setUp() self.template = ''' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Pagina del vendedor</title> </head> <body> $header <h2>Bienvenido $nombre.</h2> <br /><br /><br /> <center> Usted tiene $numpedidos_noconf <a href="">pedidós</a> sin confirmar. <br /><br /> Bodega tiene fecha para $numpedidos_bodega <a href="">pedidos</a>. </center> </body> </html> ''' def test_failure(self): """ Test a template lacking a proper #encoding tag """ self.failUnlessRaises(UnicodeDecodeError, Template, self.template, searchList=[{'header' : '', 'nombre' : '', 'numpedidos_bodega' : '', 'numpedidos_noconf' : ''}]) def test_success(self): """ Test a template with a proper #encoding tag """ template = '#encoding utf-8\n%s' % self.template template = Template(template, searchList=[{'header' : '', 'nombre' : '', 'numpedidos_bodega' : '', 'numpedidos_noconf' : ''}]) self.assertTrue(unicode(template)) if __name__ == '__main__': unittest.main()