tar_layers.py revision a5ee6ccb041ef65a86494a922e8075ae3dec0f15
#
# Copyright (C) 2014 Martin Owens, email@doctormo.org
#
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
"""
An extension to export multiple svg files from a single svg file containing layers.
Each defs is duplicated for each svg outputed.
"""
import os
import sys
import copy
import tarfile
import StringIO
import calendar
import time
# Inkscape Libraries
import inkex
import simplestyle
GROUP = "{http://www.w3.org/2000/svg}g"
LABEL = "{http://www.inkscape.org/namespaces/inkscape}label"
GROUPMODE = "{http://www.inkscape.org/namespaces/inkscape}groupmode"
"""DEBUG print an object"""
yield "%s()" % name
else:
"""DEBUG print something"""
else:
"""Entry point to our layers export"""
else:
def make_template(self):
"""Returns the current document as a new empty document with the same defs"""
return newdoc
if name:
# open output tar file as a stream (to stdout)
# Switch stdout to binary on Windows.
import msvcrt
previous = None
if previous != None:
else:
e = LayersOutput()
e.affect()
# vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 fileencoding=utf-8 textwidth=99