User:Keller999/projects/gamepageupdate: Difference between revisions

Jump to navigation Jump to search
Revised test regexps+code to: trim whitespace around params; appropriately handle optional parameters (please double check, I didn't test my recodes and it's been a while since I've written perl)
m (Revise Version Compatibility suggestion to show more recent rev (i.e. post 3.0), since pre 2.0 entries may be hidden.)
(Revised test regexps+code to: trim whitespace around params; appropriately handle optional parameters (please double check, I didn't test my recodes and it's been a while since I've written perl))
Line 112: Line 112:
} # Anything besides filled-out config params are not needed, the rest will be regenerated
} # Anything besides filled-out config params are not needed, the rest will be regenerated
} elsif ($currentSection eq "versionCompat") {
} elsif ($currentSection eq "versionCompat") {
if ($newLine =~ /^\{\{VersionCompatibilityVersion\|.+\|.+\}\}$/gi) {  # Version compat report that's been filled out
if ($newLine =~ /^\{\{VersionCompatibilityVersion\|\s*(.+)\s*\|\s*(.+)\s*(\|\s*(.+)\s*)?\}\}$/gi) {  # Version compat report that's been filled out
push (@versionCompatSection, $newLine);
$versionCompatEntry = "\{\{VersionCompatibilityVersion\|$1\|$2".(($3)?"\|$3":"")."\}\}";
push (@versionCompatSection, $versionCompatEntry);
} # Anything besides filled-out compat reports are not needed, the rest will be regenerated
} # Anything besides filled-out compat reports are not needed, the rest will be regenerated
} elsif ($currentSection eq "testing") {
} elsif ($currentSection eq "testing") {
if ($newLine =~ /^\{\{.+?\|revision\=(.*?)\|os\=(.*?)\|cpu\=(.*?)\|gpu\=(.*?)\|result\=(.*?)\|tester\=(.*?)\}\}/i) {
if ($newLine =~ /^\{\{.+?\|revision\=\s*(.*?)\s*\|os\=\s*(.*?)\s*\|cpu\=\s*(.*?)\s*\|gpu\=\s*(.*?)\s*\|result\=\s*(.*?)\s*(\|tester\=\s*(.*?)\s*)?\}\}/i) {
# Matches test reports with all variables set (tester is optional) and dissects for reassembly (muahahaha!)
# Matches test reports with all variables set (tester is optional) and dissects for reassembly (muahahaha!)
$testResult = "\{\{testing\/entry\|revision\=$1\|OS\=$2\|CPU\=$3\|GPU\=$4\|result\=$5\|tester\=$6\}\}";
$testResult = "\{\{testing\/entry\|revision\=$1\|OS\=$2\|CPU\=$3\|GPU\=$4\|result\=$5\|tester\=".(($6)?"$6":"")."\}\}";
push (@testingSection, $testResult);
push (@testingSection, $testResult);
}
}

Navigation menu