summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaphaël Bournhonesque <raphael0202@yahoo.fr>2016-03-25 18:42:17 +0000
committerRaphaël Bournhonesque <raphael0202@yahoo.fr>2016-03-25 18:42:17 +0000
commit9e0e250ae29cee879eba68fc07a4cd06edac5f41 (patch)
treed011161a62d61b4fe259ba18f42a8447d5a0c3a5
parentSwitch too broad Exception exceptions to more specific ones (IOError, ImportE... (diff)
downloadinkscape-9e0e250ae29cee879eba68fc07a4cd06edac5f41.tar.gz
inkscape-9e0e250ae29cee879eba68fc07a4cd06edac5f41.zip
Improve documentation
(bzr r14745)
-rwxr-xr-xshare/extensions/inkex.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py
index fbf1d3208..264ae0ff4 100755
--- a/share/extensions/inkex.py
+++ b/share/extensions/inkex.py
@@ -165,6 +165,9 @@ class Effect:
# TODO write a parser for this
def effect(self):
+ """Apply some effects on the document. Extensions subclassing Effect
+ must override this function and define the transformations
+ in it."""
pass
def getoptions(self,args=sys.argv[1:]):
@@ -315,6 +318,10 @@ class Effect:
# Fault tolerance for lazily defined SVG
def getDocumentHeight(self):
+ """Returns a string corresponding to the height of the document, as
+ defined in the SVG file. If it is not defined, returns the height
+ as defined by the viewBox attribute. If viewBox is not defined,
+ returns the string '0'."""
height = self.document.getroot().get('height')
if height:
return height
@@ -326,9 +333,10 @@ class Effect:
return '0'
def getDocumentUnit(self):
- """Function returns the unit used for the values in SVG.
- For lack of an attribute in SVG that explicitly defines what units are used for SVG coordinates,
- Try to calculate the unit from the SVG width and SVG viewbox.
+ """Returns the unit used for in the SVG document.
+ In the case the SVG document lacks an attribute that explicitly
+ defines what units are used for SVG coordinates, it tries to calculate
+ the unit from the SVG width and viewBox attributes.
Defaults to 'px' units."""
svgunit = 'px' # default to pixels