diff options
| author | Aaron Spike <aaron@ekips.org> | 2006-05-08 15:28:17 +0000 |
|---|---|---|
| committer | acspike <acspike@users.sourceforge.net> | 2006-05-08 15:28:17 +0000 |
| commit | 5003d4122450f1ea8d75a5f77f96b829908a7dee (patch) | |
| tree | bc478eb71aab76366fd036b788fa2fd4ae9be807 /share/extensions/extractimage.py | |
| parent | More snapping cleanups. (diff) | |
| download | inkscape-5003d4122450f1ea8d75a5f77f96b829908a7dee.tar.gz inkscape-5003d4122450f1ea8d75a5f77f96b829908a7dee.zip | |
standardize indents on 4 spaces
Python hates mixed whitespace
(bzr r770)
Diffstat (limited to 'share/extensions/extractimage.py')
| -rw-r--r-- | share/extensions/extractimage.py | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/share/extensions/extractimage.py b/share/extensions/extractimage.py index 27936bf80..f1b0f6f7a 100644 --- a/share/extensions/extractimage.py +++ b/share/extensions/extractimage.py @@ -20,31 +20,31 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import inkex, base64 class MyEffect(inkex.Effect): - def __init__(self): - inkex.Effect.__init__(self) - self.OptionParser.add_option("--filepath", - action="store", type="string", - dest="filepath", default=None, - help="") - def effect(self): - ctx = inkex.xml.xpath.Context.Context(self.document,processorNss=inkex.NSS) - - # exbed the first embedded image - path = self.options.filepath - if (path != ''): - if (self.options.ids): - for id, node in self.selected.iteritems(): - if node.tagName == 'image': - xlink = node.attributes.getNamedItemNS(inkex.NSS[u'xlink'],'href') - if (xlink.value[:4]=='data'): - comma = xlink.value.find(',') - if comma>0: - data = base64.decodestring(xlink.value[comma:]) - open(path,'wb').write(data) - xlink.value = path - else: - inkex.debug('Difficulty finding the image data.') - break + def __init__(self): + inkex.Effect.__init__(self) + self.OptionParser.add_option("--filepath", + action="store", type="string", + dest="filepath", default=None, + help="") + def effect(self): + ctx = inkex.xml.xpath.Context.Context(self.document,processorNss=inkex.NSS) + + # exbed the first embedded image + path = self.options.filepath + if (path != ''): + if (self.options.ids): + for id, node in self.selected.iteritems(): + if node.tagName == 'image': + xlink = node.attributes.getNamedItemNS(inkex.NSS[u'xlink'],'href') + if (xlink.value[:4]=='data'): + comma = xlink.value.find(',') + if comma>0: + data = base64.decodestring(xlink.value[comma:]) + open(path,'wb').write(data) + xlink.value = path + else: + inkex.debug('Difficulty finding the image data.') + break e = MyEffect() e.affect() |
