示例#1
0
 def test_compile(self):
     from compileapp import compile_application, remove_compiled_application
     import os
     for appname in ['welcome', 'admin', 'examples']:
         appname_path = os.path.join(os.getcwd(), 'applications', appname)
         compile_application(appname_path)
         remove_compiled_application(appname_path)
     return
示例#2
0
 def test_compile(self):
     #apps = ['welcome', 'admin', 'examples']
     apps = ['welcome']
     for appname in apps:
         appname_path = os.path.join(os.getcwd(), 'applications', appname)
         compile_application(appname_path)
         remove_compiled_application(appname_path)
         test_path = os.path.join(os.getcwd(), "%s.w2p" % appname)
         unpack_path = os.path.join(os.getcwd(), 'unpack', appname)
         w2p_pack(test_path, appname_path, compiled=True, filenames=None)
         w2p_pack(test_path, appname_path, compiled=False, filenames=None)
         w2p_unpack(test_path, unpack_path)
     return
 def test_compile(self):
     #apps = ['welcome', 'admin', 'examples']
     apps = ['welcome']
     for appname in apps:
         appname_path = os.path.join(os.getcwd(), 'applications', appname)
         compile_application(appname_path)
         remove_compiled_application(appname_path)
         test_path = os.path.join(os.getcwd(), "%s.w2p" % appname)
         unpack_path = os.path.join(os.getcwd(), 'unpack', appname)
         w2p_pack(test_path, appname_path, compiled=True, filenames=None)
         w2p_pack(test_path, appname_path, compiled=False, filenames=None)
         w2p_unpack(test_path, unpack_path)
     return
示例#4
0
文件: admin.py 项目: Viper525/sonospy
def app_compile(app, request):
    """
    Compiles the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object
    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return True
    except (Exception, RestrictedError):
        remove_compiled_application(folder)
        return False
示例#5
0
文件: admin.py 项目: woogiee/sonospy
def app_compile(app, request):
    """
    Compiles the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object
    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return True
    except (Exception, RestrictedError):
        remove_compiled_application(folder)
        return False
示例#6
0
def app_compile(app, request):
    """
    Compiles the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object
    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return None
    except (Exception, RestrictedError):
        tb = traceback.format_exc(sys.exc_info)
        remove_compiled_application(folder)
        return tb
示例#7
0
def app_compile(app, request):
    """Compiles the application

    Args:
        app(str): application name
        request: the global request object

    Returns:
        None if everything went ok, traceback text if errors are found

    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return None
    except (Exception, RestrictedError):
        tb = traceback.format_exc(sys.exc_info)
        remove_compiled_application(folder)
        return tb
示例#8
0
def app_compile(app, request):
    """Compiles the application

    Args:
        app(str): application name
        request: the global request object

    Returns:
        None if everything went ok, traceback text if errors are found

    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return None
    except (Exception, RestrictedError):
        tb = traceback.format_exc(sys.exc_info)
        remove_compiled_application(folder)
        return tb
示例#9
0
def app_compile(app, request):
    """
    Compiles the application

    Parameters
    ----------
    app:
        application name
    request:
        the global request object
    """
    from compileapp import compile_application, remove_compiled_application
    folder = apath(app, request)
    try:
        compile_application(folder)
        return None
    except (Exception, RestrictedError):
        tb = traceback.format_exc(sys.exc_info)
        remove_compiled_application(folder)
        return tb