Bug 336020 - Python script arguments do not update when input is updated
Summary: Python script arguments do not update when input is updated
Status: RESOLVED FIXED
Alias: None
Product: kig
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: Antonello
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2014-06-10 02:25 UTC by David E. Narvaez
Modified: 2021-07-05 13:23 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David E. Narvaez 2014-06-10 02:25:00 UTC
If one selects some input arguments for a Python script and then changes them, they are not updated in the script.

Reproducible: Always

Steps to Reproduce:
With some objects in the drawing

1. Objects -> Other -> Python Scripts
2. Don't select any input argument, hit Next
3. The script starts with def calc(  ):
4. Hit back
5. Select objects as inputs
6. Hit next
Actual Results:  
Script still starts with  def calc(  ):

Expected Results:  
Script should have some arguments, e.g.  def calc( arg1 ):
Comment 1 Andrew Crouthamel 2018-11-11 04:26:46 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 2 David E. Narvaez 2018-11-16 17:44:53 UTC
(In reply to Andrew Crouthamel from comment #1)
> This bug has been stagnant for a long time. Could you help us out and
> re-test if the bug is valid in the latest version? I am setting the status
> to NEEDSINFO pending your response, please change the Status back to
> REPORTED when you respond.

I am the maintainer for Kig, and I keep this bug around as a junior job in case newcomers want to get their feet wet.
Comment 3 Andrew Crouthamel 2018-11-17 04:46:19 UTC
Sounds good!
Comment 4 Adit Jain 2019-01-10 04:10:08 UTC
Hey I am new to the KDE community, I would like to get started (or get my feet wet as you say :)) Can I start working on this?
Comment 5 David E. Narvaez 2019-01-10 11:26:37 UTC
(In reply to Adit Jain from comment #4)
> Hey I am new to the KDE community, I would like to get started (or get my
> feet wet as you say :)) Can I start working on this?

You sure can! Welcome to KDE :)
Comment 6 Adit Jain 2019-01-11 20:17:27 UTC
Hey I cannot build kig on my pc .
Many of the dependencies are not installing.
The error that keeps popping up is:
Could not find a configuration file for package "Qt5" that is compatible
  with requested version "5.10.0".

  The following configuration files were considered but not accepted:

    /usr/lib/x86_64-linux-gnu/cmake/Qt5/Qt5Config.cmake, version: 5.9.5

Now i have installed qt5.10.0 separately on the machine and have tried to set he config of qmake to the home directory(where qt5.10.0 is) but no avail.
Please help :D .
Comment 7 Antonello 2021-05-19 00:37:46 UTC
Hi David, I had a look at this bug and I think I isolated the piece of code that is causing the issue in the description.

Before submitting a merge request I have a question about the desired final behaviour.

Consider this workflow:

1. Draw something
2. Select Objects-> Other -> Python scripts
3. Don't select any input arguments
4. Modify the python script
5. Press back
6. Select objects as inputs
7. Press next

I would assume that the modified python script should still be present and the only change would be the function definition. Is that assumption correct or should the python script be restored to the template code provided by ScriptType::templateCode (ie. any user modification will be lost)?

Thanks.
Comment 8 Bug Janitor Service 2021-05-23 08:41:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/education/kig/-/merge_requests/6
Comment 9 Yuri Chornoivan 2021-07-05 13:23:50 UTC
Git commit 2d60444fdbd91fc039254e7890423d042cf4a625 by Yuri Chornoivan, on behalf of Antonello Palazzi.
Committed on 05/07/2021 at 13:16.
Pushed by narvaez into branch 'master'.

Fix updating function signature for python scripts to reflect object selection

M  +44   -18   scripting/script-common.cc
M  +8    -0    scripting/script-common.h
M  +10   -4    scripting/script_mode.cc

https://invent.kde.org/education/kig/commit/2d60444fdbd91fc039254e7890423d042cf4a625