$95 GRAYBYTE WORDPRESS FILE MANAGER $77

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python35/lib64/python3.5/lib2to3/fixes/

HOME
Current File : /opt/alt/python35/lib64/python3.5/lib2to3/fixes//fix_unicode.py
r"""Fixer for unicode.

* Changes unicode to str and unichr to chr.

* If "...\u..." is not unicode literal change it into "...\\u...".

* Change u"..." into "...".

"""

from ..pgen2 import token
from .. import fixer_base

_mapping = {"unichr" : "chr", "unicode" : "str"}

class FixUnicode(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = "STRING | 'unicode' | 'unichr'"

    def start_tree(self, tree, filename):
        super(FixUnicode, self).start_tree(tree, filename)
        self.unicode_literals = 'unicode_literals' in tree.future_features

    def transform(self, node, results):
        if node.type == token.NAME:
            new = node.clone()
            new.value = _mapping[node.value]
            return new
        elif node.type == token.STRING:
            val = node.value
            if not self.unicode_literals and val[0] in '\'"' and '\\' in val:
                val = r'\\'.join([
                    v.replace('\\u', r'\\u').replace('\\U', r'\\U')
                    for v in val.split(r'\\')
                ])
            if val[0] in 'uU':
                val = val[1:]
            if val == node.value:
                return node
            new = node.clone()
            new.value = val
            return new


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
12 Aug 2024 8.41 AM
root / linksafe
0755
__pycache__
--
12 Aug 2024 8.41 AM
root / linksafe
0755
__init__.py
0.046 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_apply.py
2.373 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_asserts.py
0.961 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_basestring.py
0.313 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_buffer.py
0.576 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_dict.py
3.722 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_except.py
3.266 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_exec.py
0.978 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_execfile.py
1.943 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_exitfunc.py
2.437 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_filter.py
2.053 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_funcattrs.py
0.629 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_future.py
0.534 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_getcwdu.py
0.44 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_has_key.py
3.146 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_idioms.py
4.762 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_import.py
3.18 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_imports.py
5.551 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_imports2.py
0.282 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_input.py
0.691 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_intern.py
1.206 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_isinstance.py
1.57 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_itertools.py
1.512 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_itertools_imports.py
2.037 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_long.py
0.465 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_map.py
2.986 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_metaclass.py
8.011 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_methodattrs.py
0.592 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_ne.py
0.558 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_next.py
3.1 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_nonzero.py
0.583 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_numliterals.py
0.75 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_operator.py
3.39 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_paren.py
1.198 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_print.py
2.787 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_raise.py
2.857 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_raw_input.py
0.443 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_reduce.py
0.817 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_reload.py
1.127 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_renames.py
2.169 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_repr.py
0.599 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_set_literal.py
1.657 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_standarderror.py
0.438 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_sys_exc.py
1.01 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_throw.py
1.545 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_tuple_params.py
5.435 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_types.py
1.755 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_unicode.py
1.227 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_urllib.py
8.188 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_ws_comma.py
1.064 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_xrange.py
2.631 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_xreadlines.py
0.673 KB
31 May 2024 1.51 PM
root / linksafe
0644
fix_zip.py
0.881 KB
31 May 2024 1.51 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF