Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions tools/UpdatePaths/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,22 @@ def props_to_string(props):
return "{{{}}}".format(";".join([f"{k} = {v}" for k, v in props.items()]))


def string_to_props(propstring, verbose = False):
def string_to_props(propstring, verbose=False):
props = dict()
for raw_prop in re.split(split_re, propstring):
if not raw_prop or raw_prop.strip() == ';':
if not raw_prop:
continue
raw_prop = raw_prop.strip()
if not raw_prop or raw_prop == ';':
continue

prop = raw_prop.split('=', maxsplit=1)
props[prop[0].strip()] = prop[1].strip() if len(prop) > 1 else None
key = prop[0].strip()
if not key: # <-- FIX: skip empty keys
continue

props[key] = prop[1].strip() if len(prop) > 1 else None

if verbose:
print("{0} to {1}".format(propstring, props))
return props
Expand Down
40 changes: 40 additions & 0 deletions tools/UpdatePaths/__run_all.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Give the window a title so double-clicking doesn't close it immediately
$Host.UI.RawUI.WindowTitle = "UpdatePaths Runner"

# Get all .txt files tracked by Git, sorted by last commit timestamp
$files = git ls-files *.txt | ForEach-Object {
$file = $_
$timestamp = git log -1 --format="%ct" -- "$file"
[PSCustomObject]@{
File = $file
Timestamp = [int]$timestamp
}
} | Sort-Object Timestamp

$total = $files.Count
$index = 0

foreach ($item in $files) {
$index++
$percent = [math]::Round(($index / $total) * 100)

Write-Progress `
-Activity "Processing files..." `
-Status "Running Update Paths on $($item.File) ($index of $total)" `
-PercentComplete $percent

# Build safe cmd.exe command
# >nul 2>&1 silences ALL output so the progress bar stays clean
$cmdArgs = "/c echo.| "".\Update Paths.bat"" ""$($item.File)"" >nul 2>&1"

# Run the batch file and wait for it to finish
$process = Start-Process -FilePath "cmd.exe" `
-ArgumentList $cmdArgs `
-NoNewWindow `
-PassThru

$process.WaitForExit()
}

Write-Progress -Activity "Processing files..." -Completed
Read-Host "Done. Press Enter to exit."
4 changes: 0 additions & 4 deletions tools/UpdatePaths/apc_pixel_offsets.txt

This file was deleted.

5 changes: 0 additions & 5 deletions tools/UpdatePaths/camera_diag_f2w.txt

This file was deleted.

196 changes: 0 additions & 196 deletions tools/UpdatePaths/clothingunderrepath.txt

This file was deleted.

30 changes: 0 additions & 30 deletions tools/UpdatePaths/cornersfix.txt

This file was deleted.

53 changes: 0 additions & 53 deletions tools/UpdatePaths/floor_repathing.txt

This file was deleted.

1 change: 0 additions & 1 deletion tools/UpdatePaths/lib_computers.txt

This file was deleted.

56 changes: 0 additions & 56 deletions tools/UpdatePaths/pdas_to_tabs.txt

This file was deleted.

35 changes: 0 additions & 35 deletions tools/UpdatePaths/reinforcedwindows.txt

This file was deleted.

Loading
Loading