empty_generic.py revision 8ac705ee842a9087042c9ed7d126f39cadac9cec
# Written by Tavmjong Bah
import inkex
import re
self.OptionParser.add_option("-w", "--width", action="store", type="int", dest="generic_width", default="1920", help="Custom width")
self.OptionParser.add_option("-z", "--height", action="store", type="int", dest="generic_height", default="1080", help="Custom height")
self.OptionParser.add_option("-u", "--unit", action="store", type="string", dest="generic_unit", default="px", help="SVG Unit")
self.OptionParser.add_option("-b", "--background", action="store", type="string", dest="generic_background", default="normal", help="Canvas background")
self.OptionParser.add_option("-n", "--noborder", action="store", type="inkbool", dest="generic_noborder", default=False)
# self.OptionParser.add_option("-l", "--layer", action="store", type="inkbool", dest="generic_layer", default=True)
if namedview is None:
# Until units are supported in 'cx', etc.
# This nees more thought... we need to set "Current layer" to (root), how?
# if self.options.generic_layer:
# # Add layer
# inkex.debug( "We want a layer" )
# else:
# # Remove layer id default document (assuming only one)
# inkex.debug( "We don't want a layer" )
# layer_node = self.current_layer
# if layer_node is not None:
# inkex.debug( "We have layer" )
# root.remove(layer_node)
# try:
# del namedview.attrib[ inkex.addNS('current-layer', 'inkscape') ]
# except:
# pass
c = C()
c.affect()