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


Python Commands.setupjsr305方法代码示例

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


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

示例1: decompile

# 需要导入模块: from commands import Commands [as 别名]
# 或者: from commands.Commands import setupjsr305 [as 别名]
def decompile(conffile, force_jad, force_csv, no_recompile, no_comments, no_reformat, no_renamer, no_patch, only_patch,
              keep_lvt, keep_generics, only_client, only_server, force_rg, workdir, json, nocopy):
    try:
        commands = Commands(conffile, verify=True, no_patch=no_patch, workdir=workdir, json=json)

        commands.checkupdates()
        
        if not commands.has_ss:
            force_rg = True

        use_ff = commands.has_ff and not force_jad
        use_srg = commands.has_srg and not force_csv

        if force_jad and not commands.has_jad:
            commands.logger.error('!! forcing jad when not available !!')
            sys.exit(1)

        if force_rg and not commands.has_rg:
            commands.logger.error('!! forcing retroguard when not available !!')
            sys.exit(1)

        if force_csv and not commands.has_map_csv:
            commands.logger.error('!! forcing csvs when not available !!')
            sys.exit(1)

        # client or server
        process_client = True
        process_server = True
        if only_client and not only_server:
            process_server = False
        if only_server and not only_client:
            process_client = False

        # always strip comments by default, turn off in update mode if required
        strip_comments = True

        # update only options
        rg_update = False
        exc_update = False

        if no_patch:
            # no_patch is basically update mode, disables everything
            # and reuses a few different options to do update stuff
            if only_patch:
                # with only_patch then we actually do the patches, but not the comment stripping, for use when updating
                # the fernflower patches
                no_patch = False
                strip_comments = False
            if no_reformat:
                # reuse -a no_reformat to switch rg to fullmap=1 startindex=RGIndex
                rg_update = True
            if no_renamer:
                # reuse -n to switch mcinjector to outputing exc file, and adding new parameters
                exc_update = True
            no_comments = True
            no_reformat = True
            no_renamer = True
            no_recompile = True
        elif only_patch:
            # if only_patch then disable everything but patching and comment stripping
            no_comments = True
            no_reformat = True
            no_renamer = True
            no_recompile = True

        # if we have generics enabled we need the lvt as well
        if keep_generics:
            keep_lvt = True

        if force_rg:
            commands.logger.info('> Creating Retroguard config files')
            commands.creatergcfg(reobf=False, keep_lvt=keep_lvt, keep_generics=keep_generics, rg_update=rg_update)

        if not nocopy:
            clientCopy.copyClientAssets(commands, workdir)
            
        commands.setupjsr305()

        try:
            if process_client:
                cltdecomp = decompile_side(commands, CLIENT, use_ff=use_ff, use_srg=use_srg, no_comments=no_comments,
                                           no_reformat=no_reformat, no_renamer=no_renamer, no_patch=no_patch,
                                           strip_comments=strip_comments, exc_update=exc_update,
                                           keep_lvt=keep_lvt, keep_generics=keep_generics, force_rg=force_rg, rg_update=rg_update)
            else:
                cltdecomp = False
            if process_server:
                srvdecomp = decompile_side(commands, SERVER, use_ff=use_ff, use_srg=use_srg, no_comments=no_comments,
                                           no_reformat=no_reformat, no_renamer=no_renamer, no_patch=no_patch,
                                           strip_comments=strip_comments, exc_update=exc_update,
                                           keep_lvt=keep_lvt, keep_generics=keep_generics, force_rg=force_rg, rg_update=rg_update)
            else:
                srvdecomp = False
        except CalledProcessError:
            # retroguard or other called process error so bail
            commands.logger.error('Decompile failed')
            sys.exit(1)
        if not no_recompile:
            if cltdecomp:
                try:
#.........这里部分代码省略.........
开发者ID:TheValarProject,项目名称:AwakenDreamsClient,代码行数:103,代码来源:decompile.py


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