Exemplo n.º 1
0
def pyxl_transform(stream):
    try:
        output = pyxl_untokenize(pyxl_tokenize(stream.readline))
    except Exception, ex:
        print ex
        traceback.print_exc()
        raise
Exemplo n.º 2
0
def pyxl_transform(stream):
    try:
        output = pyxl_untokenize(pyxl_tokenize(stream.readline))
    except Exception, ex:
        print ex
        traceback.print_exc()
        raise
Exemplo n.º 3
0
    def __init__(self, *args, **kwargs):
        codecs.StreamReader.__init__(self, *args, **kwargs)

        try:
            data = tokenize.untokenize(pyxl_tokenize(self.stream.readline))
        except Exception, ex:
            print ex
            raise
Exemplo n.º 4
0
def p(tree):

    new_string = tokenize.untokenize(
        pyxl_tokenize(StringIO.StringIO('(' + tree.s +
                                        ')').readline)).rstrip()
    new_tree = ast.parse("from __future__ import unicode_literals;" +
                         new_string)
    return new_tree.body[1].value
Exemplo n.º 5
0
def p(tree, **kw):
    import StringIO
    new_string = tokenize.untokenize(
        pyxl_tokenize(StringIO.StringIO('(' + tree.s +
                                        ')').readline)).rstrip().rstrip("\\")
    total_string = "from __future__ import unicode_literals;" + new_string
    new_tree = ast.parse(total_string)
    return new_tree.body[1].value
Exemplo n.º 6
0
def pyxl_transform(stream, invertible=False, str_function='str'):
    try:
        output = pyxl_untokenize(pyxl_tokenize(stream.readline, invertible, str_function))
    except Exception as ex:
        print(ex)
        traceback.print_exc()
        raise

    return output
Exemplo n.º 7
0
def pyxl_transform(stream):
    try:
        output = pyxl_untokenize(pyxl_tokenize(stream.readline))
    except Exception as ex:
        print(ex)
        traceback.print_exc()
        raise

    return output.rstrip()
Exemplo n.º 8
0
def pyxl_transform(stream):
    try:
        output = pyxl_untokenize(pyxl_tokenize(stream.readline))
    except Exception as ex:
        print(ex)
        traceback.print_exc()
        raise

    return output.rstrip()
Exemplo n.º 9
0
#!/usr/bin/env python

import sys
from pyxl.codec.tokenizer import pyxl_tokenize, pyxl_untokenize

f = open(sys.argv[1], 'r')
print pyxl_untokenize(pyxl_tokenize(f.readline))
Exemplo n.º 10
0
def p(tree, **kw):
    import StringIO
    new_string = tokenize.untokenize(pyxl_tokenize(StringIO.StringIO('(' + tree.s + ')').readline)).rstrip().rstrip("\\")
    total_string = "from __future__ import unicode_literals;" + new_string
    new_tree = ast.parse(total_string)
    return new_tree.body[1].value
Exemplo n.º 11
0
#!/usr/bin/env python

import sys
from pyxl.codec.tokenizer import pyxl_tokenize, pyxl_untokenize

with open(sys.argv[1], 'r') as f:
    print(pyxl_untokenize(pyxl_tokenize(f.readline)), end='')
Exemplo n.º 12
0
def pyxl_transform(stream):
    return pyxl_untokenize(pyxl_tokenize(stream.readline)).rstrip()
Exemplo n.º 13
0
#!/usr/bin/env python

import sys
from pyxl.codec.tokenizer import pyxl_tokenize, pyxl_untokenize

f = open(sys.argv[1], 'r')
print pyxl_untokenize(pyxl_tokenize(f.readline)),
Exemplo n.º 14
0
def p(tree):

    new_string = tokenize.untokenize(pyxl_tokenize(StringIO.StringIO('(' + tree.s + ')').readline)).rstrip()
    new_tree = ast.parse("from __future__ import unicode_literals;" + new_string)
    return new_tree.body[1].value
Exemplo n.º 15
0
def pyxl_transform(stream):
    output = pyxl_untokenize(pyxl_tokenize(stream.readline))
    return output.rstrip()
Exemplo n.º 16
0
#!/usr/bin/env python
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import sys
import tokenize
from pyxl.codec.tokenizer import pyxl_tokenize

f = open(sys.argv[1], 'r')
print tokenize.untokenize(pyxl_tokenize(f.readline))
Exemplo n.º 17
0
def p(tree, **kw):
    new_string = tokenize.untokenize(pyxl_tokenize(StringIO('(' + tree.s + ')')
                                                   .readline)).rstrip().rstrip("\\")
    new_tree = ast.parse(new_string)
    return new_tree.body[0].value