Commit d8750d09 authored by Nicolas Dufour's avatar Nicolas Dufour 🎸 Committed by Martin Owens

Fix wrong data type in the parsed arguments (#265)

parent 9244cc72
......@@ -45,7 +45,7 @@ class PerfectBoundCover(inkex.EffectExtension):
pars.add_argument("--paperthicknessmeasurement", default=100.0,
help="paper thickness measurement")
pars.add_argument("--paperthickness", type=float, default=0.0, help="paper thickness")
pars.add_argument("--coverthicknessmeasurement", type=float, default=100.0,
pars.add_argument("--coverthicknessmeasurement", default=100.0,
  • @jazzynico Isn't the default value still incorrect?

  • It's supposed to be one of

    "ppi"
    "caliper"
    "points"
    "bond_weight"
    "width"
  • (no idea which one makes most sense)

  • Hi @Moini ! Sorry for the delay. You comment was in my todo list, but it took me too long to reach it...

    Yes, you're right. I only fixed what was absolutely necessary to have the extension work again, but we should change the default value too.

    Since the option list is not ordered alphabetically, I'd say the most useful value could be "ppi". Anyway, if I remember correctly, removing the default should have the same effect and point to the first element of the list.

    What would you prefer?

  • @jazzynico Hi :)

    I'd like the help string to contain all the option names, and a hint about what the default value is.

    AFAIU, from the command line, if no default is set, and there's no fallback set in the code, it will probably crash when trying to do the comparison with the 'width' string below... So there should be a default value set, or the code needs to be adapted to be able to work with empty values.

    The inx file with its options is not known when one is using the extension from the command line (standalone).

Please register or sign in to reply
help="cover thickness measurement")
pars.add_argument("--coverthickness", type=float, default=0.0, help="cover thickness")
pars.add_argument("--bleed", type=float, default=0.25, help="cover bleed (in)")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment