> So, time to brush the dust off my 2 brain cells and figure out how to
> modify srcupdatecheck's python code to parse an L4D2-style steam.inf file
> (since it seems unlikely that Valve is going to modify it to suit us... :)
>
> If anybody cares to assist/suggest, feel free. If I come up with
> something that works I'll post it.
This seems to fix it for me. I tested it with Valve's apparent steam.inf
format for L4D2, the usual (CS:S and TF2) format, and also a "bad"
steam.inf that was missing a PatchVersion= line.
This is a patch in diff -ur format:
--- srcupdatecheck.orig 2010-12-17 09:09:33.261601054 -0500
+++ srcupdatecheck 2010-12-17 10:54:07.159473612 -0500
@@ -51,8 +51,13 @@
print "File \"%s\" does not exist!" % sys.argv[1]
sys.exit(-1)
-verstring = steaminf.readline()
-verre = re.search('PatchVersion=([^\r\n]+)', verstring)
+for verstring in iter(steaminf.readline, "PatchVersion="):
+ if verstring:
+ verre = re.search('PatchVersion=([^\r\n]+)', verstring)
+ if verre:
+ break
+ else:
+ break
if not verre:
print "Invalid steam.inf file."
@@ -64,8 +69,13 @@
# Read ProductName
#
-prodstring = steaminf.readline()
-prodre = re.search('ProductName=([^\r\n]+)', prodstring)
+for prodstring in iter(steaminf.readline, "ProductName="):
+ if prodstring:
+ prodre = re.search('ProductName=([^\r\n]+)', prodstring)
+ if prodre:
+ break
+ else:
+ break
if not prodre:
print "Invalid steam.inf file."
@@ -77,8 +87,13 @@
# And AppID
#
-appstring = steaminf.readline()
-appre = re.search('appID=([^\r\n]+)', appstring)
+for appstring in iter(steaminf.readline, "appID="):
+ if appstring:
+ appre = re.search('appID=([^\r\n]+)', appstring)
+ if appre:
+ break
+ else:
+ break
if not appre:
print "Invalid steam.inf file."
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux