# Path: pyxc/util.py
# def usingPython3():
#     return sys.version_info[0] == 3
# 
# def parentOf(path):
#     return '/'.join(path.rstrip('/').split('/')[:-1])
# 
# Path: pyxc/pyxc_exceptions.py
# class PyxcError(Exception): pass
# class NoTransformationForNode(PyxcError): pass


import subprocess, os, json
        import pj.api_internal
from pyxc.util import usingPython3, parentOf
from pyxc import pyxc_exceptions





#
# Most of pyxc and pj require Python 3,
# but your build script or Django app is probably running under 2.x...
#
# Not to worry, you can use this module as-is from either 2 or 3!
#
# If you're not running 3, this module will invoke
# a <code>pj</code> subprocess to perform the compilation.
#
# The <code>pj</code> script doesn't even have to be on your <code>PATH</code>

#### Code to Code
def codeToCode(pythonCode):
    return _runViaSubprocessIfNeeded(
                    # name, args, kwargs &mdash; if we're running Python 3
                    'codeToCode',
                    [pythonCode],
                    {},
                    # input, args &mdash; for the Python 3 subprocess
                    pythonCode,

# Path: pyxc/util.py
# def usingPython3():
#     return sys.version_info[0] == 3
# 
# def parentOf(path):
#     return '/'.join(path.rstrip('/').split('/')[:-1])
# 
# Path: pyxc/pyxc_exceptions.py
# class PyxcError(Exception): pass
# class NoTransformationForNode(PyxcError): pass


# Path: pj/api.py
import subprocess, os, json
        import pj.api_internal
from pyxc.util import usingPython3, parentOf
from pyxc import pyxc_exceptions






#
# Most of pyxc and pj require Python 3,
# but your build script or Django app is probably running under 2.x...
#
# Not to worry, you can use this module as-is from either 2 or 3!
#
# If you're not running 3, this module will invoke
# a <code>pj</code> subprocess to perform the compilation.
#
# The <code>pj</code> script doesn't even have to be on your <code>PATH</code>

#### Code to Code
def codeToCode(pythonCode):
    return _runViaSubprocessIfNeeded(
                    # name, args, kwargs &mdash; if we're running Python 3
                    'codeToCode',
                    [pythonCode],
                    {},
                    # input, args &mdash; for the Python 3 subprocess
                    pythonCode,

                    ['--code-to-code'])