lifelike / hexmapextension

Inkscape extension for creating hex grids suitable for boardgame maps.
129 stars 16 forks source link

Deprecated python functions #37

Closed lifelike closed 1 year ago

lifelike commented 4 years ago

BGG-user chris newell reports at least one error and several warnings related to old python functions in this extension.

"once I'd changed "xrange" to "range" in lines 370 and 377 it seems to work fine, though there are a large numver of deprecation warnings"

cjnwl commented 4 years ago

I'm Chris Newell from BGG.

I'm using python version 3.7.1 Python 3.7.1 (v3.7.1:260ec2c36a, Oct 20 2018, 14:05:16) [MSC v.1915 32 bit (Intel)] on win32

This is contents of the execution window when I run the hexmap tool: hexmap.py:57: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option("--tab", action="store", type="string", hexmap.py:59: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-l', '--log', action = 'store', hexmap.py:61: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-c', '--cols', action = 'store', hexmap.py:65: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-r', '--rows', action = 'store', hexmap.py:69: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-z', '--hexsize', hexmap.py:72: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-w', '--strokewidth', hexmap.py:75: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-O', '--coordrows', action = 'store', hexmap.py:78: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-s', '--coordcolstart', hexmap.py:82: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-o', '--coordrowstart', hexmap.py:86: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-b', '--bricks', hexmap.py:91: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-S', '--squarebricks', hexmap.py:96: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-t', '--rotate', hexmap.py:101: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-C', '--coordseparator', hexmap.py:106: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-G', '--layers-in-group', hexmap.py:110: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-A', '--coordalphacol', action = 'store', hexmap.py:113: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-R', '--coordrevrow', action = 'store', hexmap.py:116: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-Z', '--coordzeros', action = 'store', hexmap.py:118: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-F', '--coordrowfirst', action = 'store', hexmap.py:121: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-X', '--xshift', action = 'store', hexmap.py:124: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-f', '--firstcoldown', action = 'store', hexmap.py:127: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-H', '--halfhexes', action = 'store', hexmap.py:129: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('-Q', '--verticesize', hexmap.py:134: DeprecationWarning: Effect.OptionParser oroptparsehas been deprecated and replaced withargparser.You must changeself.OptionParser.add_optiontoself.arg_parser.add_argument; the arguments are similar. self.OptionParser.add_option('--layer-' + layer, hexmap.py:509: DeprecationWarning: Effect.affect is nowEffect.run(). Theoutputargument has changed. effect.affect() hexmap.py:489: DeprecationWarning: Effect.unittouu is now a method in the svg document. Useself.svg.unittouu(str)instead. result = hex_width = self.unittouu(value.strip()) hexmap.py:293: DeprecationWarning: Effect.unittouu is now a method in the svg document. Useself.svg.unittouu(str)instead. width = float(self.unittouu(svg.get('width'))) - self.stroke_width hexmap.py:294: DeprecationWarning: Effect.unittouu is now a method in the svg document. Useself.svg.unittouu(str)instead. height = float(self.unittouu(svg.get('height'))) - self.stroke_width

lifelike commented 4 years ago

This is annoying since the deprecated functions were added to support also Inkscape 0.9. That code should not even be used in 1.0, so it would be nice if the python interpreter was not complaining about it. It is being a bit too helpful here it seems. Guess there must be some way to mark up that code to not trigger deprecation warnings.

UnicodingUnicorn commented 4 years ago

I can't seem to replicate this issue. Can I confirm what version of Inkscape are you using?