about summary refs log tree commit diff
path: root/scripts/deploy_win.py
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-05-22 15:06:15 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-05-22 15:06:15 +0000
commit90bcda3c10411ee4c1c65a494ec7c08dfdea01b4 (patch)
treeb528dccef5fd347e0ebcfd3cea7a5f0022de2edd /scripts/deploy_win.py
parent15c95783fee0eaf31b111c70dd3a17c4d70435f1 (diff)
downloadzcatch-90bcda3c10411ee4c1c65a494ec7c08dfdea01b4.tar.gz
zcatch-90bcda3c10411ee4c1c65a494ec7c08dfdea01b4.zip
move even more stuff
Diffstat (limited to 'scripts/deploy_win.py')
-rw-r--r--scripts/deploy_win.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/scripts/deploy_win.py b/scripts/deploy_win.py
new file mode 100644
index 00000000..3015ba5a
--- /dev/null
+++ b/scripts/deploy_win.py
@@ -0,0 +1,30 @@
+import zipfile

+import os, os.path

+from distutils.file_util import copy_file

+

+# A bit of dir trickery to make sure we're referring to the right dir

+# this makes it possible to run the script both from the teewars root and

+# the scripts subdir

+if os.getcwd().find("scripts") > -1:

+    dir = os.path.abspath("..")

+else:

+    dir = os.getcwd()

+

+data_dir = "%s\\%s" % (dir, 'data')

+exe_file = "%s\\%s" % (dir, 'teewars.exe')

+zip_file = "%s\\%s" % (dir, 'teewars.zip')

+

+ns = os.listdir(data_dir)

+try:

+    ns.remove('.svn')

+except:

+    pass

+zf = zipfile.ZipFile(zip_file, 'w', zipfile.ZIP_DEFLATED)

+zf.write(exe_file, 'teewars.exe')

+for n in ns:

+    zf.write(os.path.join(data_dir, n), "%s\\%s" % ('data', n))

+

+print "Data written to zip-file:\n"

+zf.printdir()

+zf.close()

+