File: package.py

package info (click to toggle)
snowballz 0.9.5.1-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 10,888 kB
  • ctags: 1,242
  • sloc: python: 7,511; makefile: 53; sh: 2
file content (20 lines) | stat: -rw-r--r-- 388 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"""
A convenience file for packaging maps.

Example::

        python package.py whiteforest

Which zips up the contents of the folder whiteforest as whiteforest.zip and
places in maps/
"""

import sys, zipfile, glob, os

name = sys.argv[1]

z = zipfile.ZipFile(name+".zip", "w")

for f in glob.glob(name+os.path.sep+"*"):
    filename = f.split(os.path.sep)[-1]
    z.write(f, filename)