Python BS + Mapmerge changes

This commit is contained in:
Daggertail
2022-02-21 04:29:11 -06:00
parent c410593ddc
commit 87d25f99d5
7 changed files with 8 additions and 7 deletions

View File

@@ -18,7 +18,7 @@ export NODE_VERSION_PRECISE=12.22.4
export SPACEMAN_DMM_VERSION=suite-1.7
# Python version for mapmerge and other tools
export PYTHON_VERSION=3.6.8
export PYTHON_VERSION=3.7.9
# Auxmos git tag
export AUXMOS_VERSION=v0.3.0

View File

@@ -1 +1,2 @@
@call powershell.exe -NoLogo -ExecutionPolicy Bypass -File "%~dp0\python_.ps1" %*
@echo off
call powershell.exe -NoLogo -ExecutionPolicy Bypass -File "%~dp0\python_.ps1" %*

View File

@@ -1,4 +1,4 @@
python36.zip
python37.zip
.
..\..\..

View File

@@ -50,7 +50,7 @@ if (!(Test-Path $PythonExe -PathType Leaf)) {
[System.IO.Compression.ZipFile]::ExtractToDirectory($Archive, $PythonDir)
# Copy a ._pth file without "import site" commented, so pip will work
Copy-Item "$Bootstrap/python36._pth" $PythonDir `
Copy-Item "$Bootstrap/python37._pth" $PythonDir `
-ErrorAction Stop
Remove-Item $Archive

View File

@@ -4,4 +4,4 @@ from . import frontend, dmm
if __name__ == '__main__':
settings = frontend.read_settings()
for fname in frontend.process(settings, "convert"):
dmm.DMM.from_file(fname).to_file(fname, settings.tgm)
dmm.DMM.from_file(fname).to_file(fname, tgm = settings.tgm)

View File

@@ -58,7 +58,7 @@ class DMM:
self.grid[coord] = self.get_or_generate_key(tile)
def generate_new_key(self):
free_keys = self._ensure_free_keys(1)
self._ensure_free_keys(1)
max_key = max_key_for(self.key_length)
# choose one of the free keys at random
key = random.randint(0, max_key - 1)

View File

@@ -96,7 +96,7 @@ def main(repo):
converted[path] = merge_map(head_files[path], dmm.DMM.from_bytes(data))
if len(working_commit.parents) != 1:
print("A merge commit was encountered before good versions of these maps were found:")
print("\n".join(f" {x}" for x in head_files.keys() - base_files.keys()))
print("\n".join(f" {x}" for x in head_files.keys() - converted.keys()))
return 1
working_commit = working_commit.parents[0]