Пример #1
0
        public MergeSet ConvertMergeSet(BuildSet bset)
        {
            MergeSet mset = new MergeSet();
            mset.src_zip = bset.zip_path;
            mset.start_bin = Path.GetFileName(bset.default_python_bin);
            mset.start_src = Path.GetFileNameWithoutExtension(bset.source_path) + bset.default_src_ex;
            mset.start_argv = bset.default_argv;
            mset.version = bset.py_version;
            mset.icon_path = bset.icon_path;
            mset.output_path = bset.output_path;
            mset.use_cache = bset.cache;
            mset.onefile = bset.one_file;
            mset.out_bin = !bset.standalone;
            mset.Decision();

            return mset;
        }
Пример #2
0
        /// <summary>
        /// Start Merge
        /// </summary>
        /// <param name="args"></param>
        static void Main_merge(string[] args)
        {
            MergeSet mset = new MergeSet();

            for (int i = 0; i < args.Length; i++)
            {
                try
                {
                    if (args[i] == "-src" | args[i] == "-s")
                    {
                        mset.src_zip = args[++i];
                    }
                    else if (args[i] == "-out" | args[i] == "-o")
                    {
                        mset.output_path = args[++i];
                    }
                    else if (args[i] == "-ver" | args[i] == "-v")
                    {
                        mset.version = args[++i];
                    }
                    else if (args[i] == "-icon" | args[i] == "-I")
                    {
                        mset.icon_path = args[++i];
                    }
                    else if (args[i] == "-start-bin" | args[i] == "-sb")
                    {
                        mset.start_bin = args[++i];
                    }
                    else if (args[i] == "-start-src" | args[i] == "-ss")
                    {
                        mset.start_src = args[++i];
                    }
                    else if (args[i] == "-start-argv" | args[i] == "-sa")
                    {
                        mset.start_argv = args[++i];
                    }
                    else if (args[i] == "--no-cache")
                    {
                        mset.use_cache = false;
                    }
                    else if (args[i] == "--no-onefile")
                    {
                        mset.onefile = false;
                    }
                    else if (args[i] == "--out-bin")
                    {
                        mset.out_bin = true;
                    }
                    else if (args[i] == "--wait-key")
                    {
                        wait_key = true;
                    }
                    else if (args[i] == "--no-log")
                    {
                        logger = false;
                    }
                    else if (args[i] == "-merge")
                    {
                    }
                    else
                    {
                        Console.WriteLine("[!] No named command options: " + args[i]);
                    }
                }
                catch { }
            }

            Console.Title = "pyDotexe " + version + " - Merge: " + mset.src_zip;
            if (logger)
            {
                Main_make_log(args, "pyDotexe_Merge_log.txt");
            }
            if (!mset.Decision())
            {
                return;
            }
            if (!Merger.Merge.Start(ref mset))
            {
                return;
            }

            Console.WriteLine("\a\r\n[+] Merging succeeded!");
            Console.WriteLine("[*] " + mset.output_path);
        }