Difference between revisions of "Python modules for extensions"

From Inkscape Wiki
Jump to navigation Jump to search
 
Line 2: Line 2:
  
 
== inkex.py ==
 
== inkex.py ==
 +
 +
This module encapsulates the basic behavior of a script extension, allowing the author to concentrate on manipulating the SVG data. The module provides an '''class Effect()'''. inkex.py was originally designed to provide the Effect (filter) extension type, but has been used for Input/Output extensions simply by overriding additional class methods.
 +
 +
=== Methods ===
 +
*effect(): override with document processing code.
 +
*affect(): actuate the script.
 +
*xpathSingle(path): an xpath wrapper to return a single node.
 +
*uniqueId(old_id, make_new_id = True): return an id that is unique in the document given a proposed id.
 +
 +
=== Properties ===
 +
 +
*document: DOM document
 +
*selected: a list of nodes that were selected in inkscape
 +
*doc_ids: all of the ids used in the document
 +
*options: options passed to the script
  
 
== simplestyle.py ==
 
== simplestyle.py ==

Revision as of 21:44, 18 November 2006


inkex.py

This module encapsulates the basic behavior of a script extension, allowing the author to concentrate on manipulating the SVG data. The module provides an class Effect(). inkex.py was originally designed to provide the Effect (filter) extension type, but has been used for Input/Output extensions simply by overriding additional class methods.

Methods

  • effect(): override with document processing code.
  • affect(): actuate the script.
  • xpathSingle(path): an xpath wrapper to return a single node.
  • uniqueId(old_id, make_new_id = True): return an id that is unique in the document given a proposed id.

Properties

  • document: DOM document
  • selected: a list of nodes that were selected in inkscape
  • doc_ids: all of the ids used in the document
  • options: options passed to the script

simplestyle.py

simplepath.py

cubicsuperpath.py

pturtle.py

beziermisc.py

cspsubdiv.py

ff*.py

an obscure set of tools for dealing with musical scales.