X7ROOT File Manager
Current Path:
/opt/alt/python27/lib64/python2.7/lib2to3/pgen2
opt
/
alt
/
python27
/
lib64
/
python2.7
/
lib2to3
/
pgen2
/
ðŸ“
..
📄
__init__.py
(143 B)
📄
__init__.pyc
(187 B)
📄
__init__.pyo
(187 B)
📄
conv.py
(9.4 KB)
📄
conv.pyc
(8.07 KB)
📄
conv.pyo
(6.95 KB)
📄
driver.py
(5.9 KB)
📄
driver.pyc
(6.48 KB)
📄
driver.pyo
(6.42 KB)
📄
grammar.py
(6.44 KB)
📄
grammar.pyc
(7.64 KB)
📄
grammar.pyo
(7.64 KB)
📄
literals.py
(1.58 KB)
📄
literals.pyc
(2.02 KB)
📄
literals.pyo
(1.79 KB)
📄
parse.py
(7.86 KB)
📄
parse.pyc
(7.22 KB)
📄
parse.pyo
(7.18 KB)
📄
pgen.py
(13.5 KB)
📄
pgen.pyc
(12.36 KB)
📄
pgen.pyo
(11.76 KB)
📄
token.py
(1.24 KB)
📄
token.pyc
(2.3 KB)
📄
token.pyo
(2.3 KB)
📄
tokenize.py
(18.79 KB)
📄
tokenize.pyc
(16.83 KB)
📄
tokenize.pyo
(16.74 KB)
Editing: literals.py
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Safely evaluate Python string literals without using eval().""" import re simple_escapes = {"a": "\a", "b": "\b", "f": "\f", "n": "\n", "r": "\r", "t": "\t", "v": "\v", "'": "'", '"': '"', "\\": "\\"} def escape(m): all, tail = m.group(0, 1) assert all.startswith("\\") esc = simple_escapes.get(tail) if esc is not None: return esc if tail.startswith("x"): hexes = tail[1:] if len(hexes) < 2: raise ValueError("invalid hex string escape ('\\%s')" % tail) try: i = int(hexes, 16) except ValueError: raise ValueError("invalid hex string escape ('\\%s')" % tail) else: try: i = int(tail, 8) except ValueError: raise ValueError("invalid octal string escape ('\\%s')" % tail) return chr(i) def evalString(s): assert s.startswith("'") or s.startswith('"'), repr(s[:1]) q = s[0] if s[:3] == q*3: q = q*3 assert s.endswith(q), repr(s[-len(q):]) assert len(s) >= 2*len(q) s = s[len(q):-len(q)] return re.sub(r"\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3})", escape, s) def test(): for i in range(256): c = chr(i) s = repr(c) e = evalString(s) if e != c: print i, c, s, e if __name__ == "__main__": test()
Upload File
Create Folder