Skip to content
Browse files

fixed issues with python2.6

  • Loading branch information...
1 parent 1eec4da commit de4835e27dcf29841ce1603431f3a803717ca43b unknown committed Feb 10, 2010
Showing with 27 additions and 9 deletions.
  1. +16 −9 server/springboard.py
  2. +6 −0 springboard.vbs
  3. +5 −0 springboard_debug.bat
View
25 server/springboard.py
@@ -68,23 +68,27 @@ def build_client_zip(config, client_path, target_zip):
fullpath = os.path.join(base, file)
- fname = fullpath
- tf = tempfile.NamedTemporaryFile(mode="w")
-
+ f = None
+
if os.path.splitext(fullpath)[1] == ".brs":
print "rewriting %s" % fullpath
+ tf = tempfile.TemporaryFile()
+
# rewrite doing the necessary substitutions
f = open(fullpath)
for ln in f:
url = server_base(config)
nln = re.sub('SERVER_NAME', url, ln)
tf.write(nln)
- tf.flush()
- fname = tf.name
-
+ tf.seek(0)
+ f = tf
+ else:
+ f = open(fullpath)
+
relpath = relpath26(fullpath, client_path)
- zip.write(fname, arcname=relpath)
+ zip.writestr(relpath, f.read())
+ f.close()
print "added %s to zip as %s" % (fullpath, relpath)
zip.close()
@@ -174,8 +178,11 @@ def __init__(self, root, server):
def stop_server(self):
print "stopping server"
- terminate(self.server)
- os.waitpid(self.server.pid, 0)
+ if sys.version_info[0:2] >= (1,6):
+ self.server.kill()
+ else:
+ terminate(self.server)
+ os.waitpid(self.server.pid, 0)
self.root.destroy()
root = Tk()
View
6 springboard.vbs
@@ -0,0 +1,6 @@
+rem Contributed by umbighouse
+rem Copyright 2010
+
+Set WshShell = CreateObject("WScript.Shell")
+WshShell.Run chr(34) & "springboard_debug.bat" & Chr(34), 0
+Set WshShell = Nothing
View
5 springboard_debug.bat
@@ -0,0 +1,5 @@
+rem Contributed by umbighouse
+rem copyright 2010
+
+cd server
+c:\python26\python.exe springboard.py

0 comments on commit de4835e

Please sign in to comment.
Something went wrong with that request. Please try again.