@@ 1600-1618 (lines=19) @@ | ||
1597 | except ImportError: |
|
1598 | from py2exe.build_exe import py2exe as _py2exe # py2 |
|
1599 | ||
1600 | class cmd_py2exe(_py2exe): |
|
1601 | def run(self): |
|
1602 | root = get_root() |
|
1603 | cfg = get_config_from_root(root) |
|
1604 | versions = get_versions() |
|
1605 | target_versionfile = cfg.versionfile_source |
|
1606 | print("UPDATING %s" % target_versionfile) |
|
1607 | write_to_version_file(target_versionfile, versions) |
|
1608 | ||
1609 | _py2exe.run(self) |
|
1610 | os.unlink(target_versionfile) |
|
1611 | with open(cfg.versionfile_source, "w") as f: |
|
1612 | LONG = LONG_VERSION_PY[cfg.VCS] |
|
1613 | f.write(LONG % |
|
1614 | {"DOLLAR": "$", |
|
1615 | "STYLE": cfg.style, |
|
1616 | "TAG_PREFIX": cfg.tag_prefix, |
|
1617 | "PARENTDIR_PREFIX": cfg.parentdir_prefix, |
|
1618 | "VERSIONFILE_SOURCE": cfg.versionfile_source, |
|
1619 | }) |
|
1620 | cmds["py2exe"] = cmd_py2exe |
|
1621 | ||
@@ 1571-1589 (lines=19) @@ | ||
1568 | # "product_version": versioneer.get_version(), |
|
1569 | # ... |
|
1570 | ||
1571 | class cmd_build_exe(_build_exe): |
|
1572 | def run(self): |
|
1573 | root = get_root() |
|
1574 | cfg = get_config_from_root(root) |
|
1575 | versions = get_versions() |
|
1576 | target_versionfile = cfg.versionfile_source |
|
1577 | print("UPDATING %s" % target_versionfile) |
|
1578 | write_to_version_file(target_versionfile, versions) |
|
1579 | ||
1580 | _build_exe.run(self) |
|
1581 | os.unlink(target_versionfile) |
|
1582 | with open(cfg.versionfile_source, "w") as f: |
|
1583 | LONG = LONG_VERSION_PY[cfg.VCS] |
|
1584 | f.write(LONG % |
|
1585 | {"DOLLAR": "$", |
|
1586 | "STYLE": cfg.style, |
|
1587 | "TAG_PREFIX": cfg.tag_prefix, |
|
1588 | "PARENTDIR_PREFIX": cfg.parentdir_prefix, |
|
1589 | "VERSIONFILE_SOURCE": cfg.versionfile_source, |
|
1590 | }) |
|
1591 | cmds["build_exe"] = cmd_build_exe |
|
1592 | del cmds["build_py"] |