countersheetsextension icon indicating copy to clipboard operation
countersheetsextension copied to clipboard

Inkscape 1.2.1 deprecated viewport attributes

Open lifelike opened this issue 3 years ago • 1 comments

As seen in issue #87 and issue #88, there are some deprecation warnings printed in a dialog window when running the effect in Inkscape 1.2.1 (seen in Windows, but probably affects all platforms):

C:\Program Files\Inkscape\share\inkscape\extensions\countersheet.py:1350: DeprecationWarning: inkex.elements._svg.width -> Use :func:viewport_width instead self.logwrite("svg.width: %s\n" % self.svg.width) C:\Program Files\Inkscape\share\inkscape\extensions\countersheet.py:1351: DeprecationWarning: inkex.elements._svg.height -> Use :func:viewport_height instead

lifelike avatar Aug 08 '22 19:08 lifelike

I was having the same issue, but was able to work around it by commenting lines 1350 & 1350 in countersheet.py and then restarting inkscape:

    self.logwrite("svg.width: %s\n" % self.svg.width)  -> #self.logwrite("svg.width: %s\n" % self.svg.width)
    self.logwrite("svg.height: %s\n" % self.svg.height) -> #self.logwrite("svg.height: %s\n" % self.svg.height)

This works for now and should be seen as a temporary fix in case further deprecations break the extension...

Good luck, all!

jlr1001 avatar Sep 28 '22 15:09 jlr1001

is there any way to supress warnings? Looks like the error might just be a logging error if I comment the lines above (thanks jlr1001), but are we sure there are no unexpected effects? Thanks for all the efforts, as always, John

jzedwards avatar Nov 20 '22 08:11 jzedwards