webslicer_export.py revision d3f6aa3df5556f279194848b5bd571ff67fdaf66
'''
Copyright (C) 2010 Aurelio A. Heckert, aurium (a) gmail dot 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
'''
from webslicer_effect import *
import inkex
import gettext
import tempfile
import commands
class WebSlicer_Export(WebSlicer_Effect):
dest="dir",
help="")
dest="create_dir",
help="")
dest="with_code",
help="")
# The user must supply a directory to export:
return {'error':'You must to give a directory to export the slices.'}
# No directory separator at the path end:
# Test if the directory exists:
# Try to create it:
try:
except Exception as e:
return {'error':'Can\'t create the directory to export.'}
else:
return
# Create HTML and CSS files, if the user wants:
try:
except Exception as e:
return {'error':'Can\'t create code files.'}
# Create the temporary SVG with invisible Slicer layer to export image pieces
# Start what we really want!
# Close the HTML and CSS files:
# Delete the temporary SVG with invisible Slicer layer
def create_the_temporary_svg(self):
def delete_the_temporary_svg(self):
conf = {}
if desc is not None:
#desc = desc.text.split("\n")
return conf
else:
#inkex.errormsg( 'group CSS and HTML' )
#inkex.errormsg( 'unity CSS and HTML' )
"inkscape -i '%s' -e '%s' '%s'" % (
)
)
#inkex.errormsg( status )
#inkex.errormsg( output )
if __name__ == '__main__':
e = WebSlicer_Export()
e.affect()