2bb844445fc39ea4062164df027280516cd281a2,PyInstaller/utils/cliutils/grab_version.py,,run,#,19

Before Change



    out_filename = os.path.abspath("file_version_info.txt")

    if len(sys.argv) < 2:
        print("Usage: python grab_version.py <exe>  [ out.txt ]")
        print(" where: <exe> is the fullpathname of a Windows executable and")
        print(" <out.txt> is the optional pathname where the grabbed")
        print(" version info will be saved.")
        print(" default out filename:  file_version_info.txt")
        print(" The printed output may be saved to a file, edited and")
        print(" used as the input for a version resource on any of the")
        print(" executable targets in an Installer spec file.")
        raise SystemExit(1)

    if len(sys.argv) == 3:
        out_filename = os.path.abspath(sys.argv[2])

    try:

After Change


def run():
    PyInstaller.log.init()

    parser = argparse.ArgumentParser(
        epilog = ("The printed output may be saved to a file, edited and "
                  "used as the input for a version resource on any of the "
                  "executable targets in an Installer spec file."))
    parser.add_argument("exe_file", metavar="exe-file",
                        help="full pathname of a Windows executable")
    parser.add_argument("out_filename", metavar="out-filename", nargs="?",
                        default="file_version_info.txt",
                        help=("filename where the grabbed version info "
                              "will be saved"))

    args = parser.parse_args()

    try:
        vs = PyInstaller.utils.win32.versioninfo.decode(args.exe_file)
        fp = codecs.open(args.out_filename, "w", "utf-8")
        fp.write(unicode(vs))
        fp.close()
        print(("Version info written to: %s" % out_filename))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: pyinstaller/pyinstaller
Commit Name: 2bb844445fc39ea4062164df027280516cd281a2
Time: 2015-10-20
Author: h.goebel@crazy-compilers.com
File Name: PyInstaller/utils/cliutils/grab_version.py
Class Name:
Method Name: run


Project Name: pyinstaller/pyinstaller
Commit Name: c2b11cd70fc5a9f64750e80845990cc715cb3d12
Time: 2015-10-20
Author: h.goebel@crazy-compilers.com
File Name: PyInstaller/utils/cliutils/set_version.py
Class Name:
Method Name: run


Project Name: matplotlib/matplotlib
Commit Name: 52136a7dda72978004f6af8e90e9ebe7596c27b8
Time: 2019-11-26
Author: anntzer.lee@gmail.com
File Name: examples/misc/image_thumbnail_sgskip.py
Class Name:
Method Name:


Project Name: pyinstaller/pyinstaller
Commit Name: 2bb844445fc39ea4062164df027280516cd281a2
Time: 2015-10-20
Author: h.goebel@crazy-compilers.com
File Name: PyInstaller/utils/cliutils/grab_version.py
Class Name:
Method Name: run