[GRASS-SVN] r57118 - grass/trunk/scripts/v.pack
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jul 14 07:12:16 PDT 2013
Author: martinl
Date: 2013-07-14 07:12:16 -0700 (Sun, 14 Jul 2013)
New Revision: 57118
Modified:
grass/trunk/scripts/v.pack/v.pack.py
Log:
v.pack: remove tmp dir when exiting
Modified: grass/trunk/scripts/v.pack/v.pack.py
===================================================================
--- grass/trunk/scripts/v.pack/v.pack.py 2013-07-14 13:56:53 UTC (rev 57117)
+++ grass/trunk/scripts/v.pack/v.pack.py 2013-07-14 14:12:16 UTC (rev 57118)
@@ -35,10 +35,14 @@
import sys
import shutil
import tarfile
+import atexit
from grass.script import core as grass
from grass.script import vector as vector
+def cleanup():
+ grass.try_rmdir(basedir)
+
def main():
infile = options['input']
compression_off = flags['c']
@@ -73,6 +77,7 @@
# prepare for packing
grass.verbose(_("Packing <%s>...") % (gfile['fullname']))
+ global basedir
basedir = grass.tempdir()
# write tar file, optional compression
@@ -110,4 +115,5 @@
if __name__ == "__main__":
options, flags = grass.parser()
+ atexit.register(cleanup)
sys.exit(main())
More information about the grass-commit
mailing list