当前位置: 首页>>代码示例>>Python>>正文


Python Setup.defaultSetup方法代码示例

本文整理汇总了Python中ufora.config.Setup.defaultSetup方法的典型用法代码示例。如果您正苦于以下问题:Python Setup.defaultSetup方法的具体用法?Python Setup.defaultSetup怎么用?Python Setup.defaultSetup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ufora.config.Setup的用法示例。


在下文中一共展示了Setup.defaultSetup方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: UserFacingMainline

# 需要导入模块: from ufora.config import Setup [as 别名]
# 或者: from ufora.config.Setup import defaultSetup [as 别名]
def UserFacingMainline(main, argv, modulesToInitialize=None, parser=None):
    """Helper function that initializes some modules and then calls main.

    Used to centralize error handling for common initialization routines and to set up the
    initial component hosts.
    """
    if parser is None:
        parser = Setup.defaultParser()

    setup = Setup.defaultSetup()

    parsedArguments = parser.parse_args(argv[1:])
    setup.processArgs(parsedArguments)

    setup.config.configureLoggingForUserProgram()

    with Setup.PushSetup(setup):
        initializeModules(modulesToInitialize)

        result = main(parsedArguments)

        if result is None:
            result = 0

        sys.stdout.flush()
        sys.stderr.flush()

        os._exit(result)
开发者ID:Sandy4321,项目名称:ufora,代码行数:30,代码来源:Mainline.py

示例2: main

# 需要导入模块: from ufora.config import Setup [as 别名]
# 或者: from ufora.config.Setup import defaultSetup [as 别名]
def main(argv):
	t0 = time.time()

	Runtime.initialize(Setup.defaultSetup())
	
	runtime = Runtime.getMainRuntime()
	handler = runtime.getInterpreterTraceHandler()

	handler.replayTracesFromFile(argv[1])

	print "took ", time.time() - t0
开发者ID:vishnur,项目名称:ufora,代码行数:13,代码来源:replayInterpreterTracesThroughCompiler.py

示例3: executeTestAsMain

# 需要导入模块: from ufora.config import Setup [as 别名]
# 或者: from ufora.config.Setup import defaultSetup [as 别名]
def executeTestAsMain():
    with Setup.PushSetup(Setup.defaultSetup()):
        #tests = ['testKeys', 'testMutableDefaults', 'testProperty', 'testChangeMutable', 'testLocationAccess', 'testFunction', 'testInitializer', 'testCached', 'testNotCached', 'testRootProperty']
        #tests = ['testProperty']
        tests = ['testTemp']
        #tests = ['testOrphan']
        #tests = ['testLocKey2']
        #tests = ['testKeys']
        #tests = ['testCreate']
        suite = unittest.TestSuite(map(ComputedGraphTest, tests))
        unittest.TextTestRunner().run(suite)
开发者ID:Sandy4321,项目名称:ufora,代码行数:13,代码来源:ComputedGraph.test.py

示例4: set

# 需要导入模块: from ufora.config import Setup [as 别名]
# 或者: from ufora.config.Setup import defaultSetup [as 别名]
        for filename in foraFiles:
            foraModule = FORA.importModule(os.path.join(testPath, filename))
            moduleMembersAndMetadataDict = FORA.objectMembers(foraModule)

            for memberName, memberMetadata in moduleMembersAndMetadataDict.iteritems():
                if self.isPerfTestCase(memberMetadata):
                    if filename not in perfTestCases:
                        perfTestCases[filename] = set()
                    perfTestCases[filename].add(memberName)
                    metadataForPerfTestCases[(filename, memberName)] = memberMetadata.outer

        return perfTestCases, metadataForPerfTestCases

if __name__ == "__main__":
    setup = Setup.defaultSetup()
    with Setup.PushSetup(setup):
        Setup.config().configureLoggingForUserProgram()

        FORA.initialize()

        langfilter = None
        listOnly = False

        try:
            result = test()
        except:
            logging.critical(traceback.format_exc())
            result = 1

开发者ID:Sandy4321,项目名称:ufora,代码行数:30,代码来源:localperf.py

示例5: open

# 需要导入模块: from ufora.config import Setup [as 别名]
# 或者: from ufora.config.Setup import defaultSetup [as 别名]
#   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.

"""
rebuildAxiomSearchFunction

Generate appropriate axiom build functions after we've built the project successfully.
"""

import os
import ufora
import ufora.config.Setup as Setup
import ufora.FORA.python.Runtime as Runtime

Runtime.initialize(Setup.defaultSetup())

axioms = Runtime.getMainRuntime().getAxioms()

implvalCode, jovtCode = axioms.getCppWrapperCode()

uforaDir = os.path.split(os.path.abspath(ufora.__file__))[0]

with open(os.path.join(uforaDir, "FORA", "Axioms", "AxiomSearch.cpp"), "w") as f:
    print >> f, "//generated by ufora/scripts/rebuildAxiomSearchFunction.py"
    print >> f, implvalCode

with open(os.path.join(uforaDir, "FORA", "Axioms", "AxiomSearch2.cpp"), "w") as f:
    print >> f, "//generated by ufora/scripts/rebuildAxiomSearchFunction.py"
    print >> f, jovtCode
开发者ID:vishnur,项目名称:ufora,代码行数:32,代码来源:rebuildAxiomSearchFunction.py

示例6: UnitTestMainline

# 需要导入模块: from ufora.config import Setup [as 别名]
# 或者: from ufora.config.Setup import defaultSetup [as 别名]
def UnitTestMainline(modulesToInitialize=None,
                     exit=True,
                     loginConfiguration=LoginConfiguration.LoginConfiguration.defaultForTesting(),
                     disableLogCapture=False):
    """Helper function to call the unittest mainline

    Constructs a default Setup from the config. Calls
        x.initialize(setup)
    for all x in modulesToInitialize.
    """
    modulesToInitialize = modulesToInitialize or []
    import ufora.native

    argv = list(sys.argv)
    setup = Setup.defaultSetup()

    parser = Setup.defaultParser()

    unitTestOptions = parser.add_argument_group(
        title='UnitTestMainline options',
        description='options for the general UnitTest framework'
        )
    addNoseVerbosityArgument(unitTestOptions)

    unitTestOptions.add_argument(
        'testHarnessArguments',
        nargs=argparse.REMAINDER
        )

    parser.add_argument('-timeout',
                        type=float,
                        nargs=1,
                        help='fail test if not completed after TIMEOUT seconds',
                        default=None)

    parsedArguments = parser.parse_args(argv[1:])

    if parsedArguments.timeout is not None:
        UnitTestCommon.startTimeoutThread(parsedArguments.timeout[0])

    setup.processArgs(parsedArguments)

    testHarnessArguments = ["dummy"] + parsedArguments.testHarnessArguments

    testHarnessArguments.append('--verbosity=0')

    if parsedArguments.testHarnessVerbose or disableLogCapture:
        testHarnessArguments.append('--nocaptureall')
    setup.config.configureLoggingForUserProgram()

    plugins = nose.plugins.manager.PluginManager([OutputCaptureNosePlugin()])


    config = nose.config.Config(plugins=plugins)
    config.configure(testHarnessArguments)

    with Setup.PushSetup(setup):
        result = None
        for toInitialize in modulesToInitialize:
            toInitialize.initialize(setup)

        result = nose.core.TestProgram(
            exit=False,
            defaultTest="__main__",
            config=config,
            argv=testHarnessArguments
            ).success

        sys.stdout.flush()
        sys.stderr.flush()
        ufora.native.Tests.gcov_flush()

        if not exit:
            return 0 if result else 1
        else:
            os._exit(0 if result else 1)
开发者ID:Sandy4321,项目名称:ufora,代码行数:78,代码来源:Mainline.py


注:本文中的ufora.config.Setup.defaultSetup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。