Commit 2d76736f authored by Michael Büsch's avatar Michael Büsch

Move cython logic to separate awlsim_loader module

This avoids loader magic issues
Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent 150d9b0e
......@@ -21,13 +21,12 @@
#
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import sys
import getopt
from awlsim.common import *
from awlsim.coreclient import *
from awlsim_loader.common import *
from awlsim_loader.coreclient import *
class TextInterfaceAwlSimClient(AwlSimClient):
......
......@@ -21,16 +21,15 @@
#
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import sys
import os
import time
import getopt
from awlsim.common import *
from awlsim.coreserver.server import *
from awlsim.coreclient.client import *
from awlsim_loader.common import *
from awlsim_loader.coreserver import *
from awlsim_loader.coreclient import *
class LinuxCNC_NotRunning(Exception):
......
......@@ -21,16 +21,15 @@
#
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import sys
import getopt
from socket import AF_INET, AF_INET6
from awlsim.common import *
from awlsim.core import *
from awlsim.coreclient.client import *
from awlsim.coreserver.server import *
from awlsim_loader.common import *
from awlsim_loader.core import *
from awlsim_loader.coreclient import *
from awlsim_loader.coreserver import *
def usage():
......
......@@ -21,13 +21,12 @@
#
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import sys
import getopt
from awlsim.common import *
from awlsim.core.symbolparser import *
from awlsim_loader.common import *
from awlsim_loader.core import *
def usage():
......
......@@ -28,9 +28,10 @@ import getopt
import traceback
import signal
from awlsim.common import *
from awlsim.core import *
from awlsim.coreclient.client import *
from awlsim_loader.common import *
from awlsim_loader.core import *
from awlsim_loader.coreclient import *
import awlsim_loader.cython_helper as cython_helper
class TestAwlSimClient(AwlSimClient):
......@@ -159,8 +160,7 @@ def assignCpuSpecs(cpuSpecs, projectCpuSpecs):
def run(inputFile):
s = None
try:
import awlsim.cython_helper
if awlsim.cython_helper.shouldUseCython():
if cython_helper.shouldUseCython():
writeStdout("*** Using accelerated CYTHON core "
"(AWLSIM_CYTHON environment variable is set)\n")
......@@ -252,8 +252,7 @@ def runWithServerBackend(inputFile):
client = None
tunnel = None
try:
import awlsim.cython_helper
if awlsim.cython_helper.shouldUseCython():
if cython_helper.shouldUseCython():
printError("The accelerated CYTHON core currently is incompatible "
"with the backend server. Please remove the "
"AWLSIM_CYTHON environment variable.")
......
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import awlsim.cython_helper as __cython
if __cython.shouldUseCython(__name__): #@nocy
#if True: #@cy
try:
from awlsim_cython.common.all_modules import * #<no-cython-patch
except ImportError as e:
__cython.cythonImportError(__name__, str(e))
if not __cython.shouldUseCython(__name__): #@nocy
from awlsim.common.all_modules import * #@nocy
from awlsim.common.blocker import *
from awlsim.common.cpuspecs import *
from awlsim.common.datatypehelpers import *
from awlsim.common.debug import *
from awlsim.common.enumeration import *
from awlsim.common.exceptions import *
from awlsim.common.immutable import *
from awlsim.common.net import *
from awlsim.common.project import *
from awlsim.common.subprocess import *
from awlsim.common.templates import *
from awlsim.common.util import *
from awlsim.common.version import *
from awlsim.common.wordpacker import *
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.common.blocker import *
from awlsim.common.cpuspecs import *
from awlsim.common.datatypehelpers import *
from awlsim.common.debug import *
from awlsim.common.enumeration import *
from awlsim.common.exceptions import *
from awlsim.common.immutable import *
from awlsim.common.net import *
from awlsim.common.project import *
from awlsim.common.subprocess import *
from awlsim.common.templates import *
from awlsim.common.util import *
from awlsim.common.version import *
from awlsim.common.wordpacker import *
......@@ -28,7 +28,7 @@ def importModule(moduleName):
Returns the module object.
May raise importError."""
import awlsim.cython_helper as cython_helper
import awlsim_loader.cython_helper as cython_helper
try:
import importlib
except ImportError as e:
......
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import awlsim.cython_helper as __cython
if __cython.shouldUseCython(__name__): #@nocy
#if True: #@cy
try:
from awlsim_cython.core.all_modules import * #<no-cython-patch
except ImportError as e:
__cython.cythonImportError(__name__, str(e))
if not __cython.shouldUseCython(__name__): #@nocy
from awlsim.core.all_modules import * #@nocy
from awlsim.core.main import *
from awlsim.core.cpu import *
from awlsim.core.hardware import *
from awlsim.core.parser import *
from awlsim.core.util import *
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.core.main import *
from awlsim.core.cpu import *
from awlsim.core.hardware import *
from awlsim.core.parser import *
from awlsim.core.util import *
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim.cython_helper as __cython
if __cython.shouldUseCython(__name__): #@nocy
#if True: #@cy
try:
from awlsim_cython.coreclient.all_modules import * #<no-cython-patch
except ImportError as e:
__cython.cythonImportError(__name__, str(e))
if not __cython.shouldUseCython(__name__): #@nocy
from awlsim.coreclient.all_modules import * #@nocy
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim.cython_helper as __cython
if __cython.shouldUseCython(__name__): #@nocy
#if True: #@cy
try:
from awlsim_cython.coreserver.all_modules import * #<no-cython-patch
except ImportError as e:
__cython.cythonImportError(__name__, str(e))
if not __cython.shouldUseCython(__name__): #@nocy
from awlsim.coreserver.all_modules import * #@nocy
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
......@@ -20,11 +20,10 @@
#
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.common import *
from awlsim.coreclient.client import *
import awlsim.cython_helper
from awlsim_loader.common import *
from awlsim_loader.coreclient import *
import awlsim_loader.cython_helper as cython_helper
import sys
import traceback
......@@ -35,7 +34,7 @@ if isPyPy or isJython:
printError("Please use CPython 2.7 or CPython 3.x")
sys.exit(1)
if awlsim.cython_helper.shouldUseCython():
if cython_helper.shouldUseCython():
print("*** Using accelerated CYTHON core "
"(AWLSIM_CYTHON environment variable is set)")
......
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim.cython_helper as __cython
if __cython.shouldUseCython(__name__): #@nocy
#if True: #@cy
try:
from awlsim_cython.library.all_modules import * #<no-cython-patch
except ImportError as e:
__cython.cythonImportError(__name__, str(e))
if not __cython.shouldUseCython(__name__): #@nocy
from awlsim.library.all_modules import * #@nocy
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
import awlsim.cython_helper as __cython
from awlsim.library.iec.iec import *
if __cython.shouldUseCython(__name__): #@nocy
#if True: #@cy
try:
from awlsim_cython.library.iec.all_modules import * #<no-cython-patch
except ImportError as e:
__cython.cythonImportError(__name__, str(e))
if not __cython.shouldUseCython(__name__): #@nocy
from awlsim.library.iec.all_modules import * #@nocy
from awlsim.library.iec.fc4_delete import *
from awlsim.library.iec.fc9_eq_dt import *
from awlsim.library.iec.fc12_ge_dt import *
from awlsim.library.iec.fc21_len import *
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from awlsim.library.iec.iec import *
from awlsim.library.iec.fc4_delete import *
from awlsim.library.iec.fc9_eq_dt import *
from awlsim.library.iec.fc12_ge_dt import *
from awlsim.library.iec.fc21_len import *
from __future__ import division, absolute_import, print_function, unicode_literals
from awlsim.common.compat import *
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim_loader.cython_helper as __cython
__importmod = "awlsim.common"
if __cython.shouldUseCython(__importmod): #@nocy
#if True: #@cy
__importcymod = __cython.cythonModuleName(__importmod)
try:
exec("from %s import *" % __importcymod)
except ImportError as e:
__cython.cythonImportError(__importcymod, str(e))
if not __cython.shouldUseCython(__importmod): #@nocy
exec("from %s import *" % __importmod) #@nocy
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim_loader.cython_helper as __cython
__importmod = "awlsim.core"
if __cython.shouldUseCython(__importmod): #@nocy
#if True: #@cy
__importcymod = __cython.cythonModuleName(__importmod)
try:
exec("from %s import *" % __importcymod)
except ImportError as e:
__cython.cythonImportError(__importcymod, str(e))
if not __cython.shouldUseCython(__importmod): #@nocy
exec("from %s import *" % __importmod) #@nocy
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim_loader.cython_helper as __cython
__importmod = "awlsim.coreclient.client"
if __cython.shouldUseCython(__importmod): #@nocy
#if True: #@cy
__importcymod = __cython.cythonModuleName(__importmod)
try:
exec("from %s import *" % __importcymod)
except ImportError as e:
__cython.cythonImportError(__importcymod, str(e))
if not __cython.shouldUseCython(__importmod): #@nocy
exec("from %s import *" % __importmod) #@nocy
from __future__ import division, absolute_import, print_function, unicode_literals
import awlsim_loader.cython_helper as __cython
__importmod = "awlsim.coreserver.server"
if __cython.shouldUseCython(__importmod): #@nocy
#if True: #@cy
__importcymod = __cython.cythonModuleName(__importmod)
try:
exec("from %s import *" % __importcymod)
except ImportError as e:
__cython.cythonImportError(__importcymod, str(e))
if not __cython.shouldUseCython(__importmod): #@nocy
exec("from %s import *" % __importmod) #@nocy
......@@ -129,6 +129,7 @@ setup( name = "awlsim",
author_email = "m@bues.ch",
url = "https://bues.ch/a/awlsim",
packages = [ "awlsim",
"awlsim_loader",
"awlsim/common",
"awlsim/core",
"awlsim/core/instructions",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment