g2pngs.py revision 6f2291d178a59c46eedaeaca3a87013cca5f46be
'''
Copyright (C) 2006 cedric GEMY, cedric@le-radar.com
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
TODO :
specify save format, scale
save selected
RELEASE NOTE
- can export layers only as separate pngs
- Default directory = $Home
- create the dest dir if doesn't exists
'''
import inkex
help="Existing destination directory")
help="Save layers with their groups")
'''self.OptionParser.add_option("-s", "--scale",
action="store", type="float",
dest="scale", default=100,
help="Scales the group at the specified value")
self.OptionParser.add_option("-f", "--format",
action="store", type="string",
dest="format", default="png",
help="Save at the specified format [only PNG implemented yet]")
'''
pass
'''docname = node.attributes.getNamedItemNS(inkex.NSS[u'sodipodi'],'docname').value[:-4]'''
#create os temp dir
'''tmp_dir = tempfile.mkdtemp()'''
"""area = '--export-area-canvas'"""
pngs = []
path = "/svg/*[name()='g' or @style][@id]"
else:
path = "/svg/g/*[name()='g' or @style][@id]"
f.read()
f.close()
e = MyEffect()
e.affect()