Bug 115116 - Python wizard code seems to call a substring() method that Python string objects don't have
Summary: Python wizard code seems to call a substring() method that Python string obje...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-19 19:31 UTC by How can I remove my account?
Modified: 2019-03-12 10:23 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description How can I remove my account? 2018-01-19 19:31:26 UTC
Description:
> git grep -w substring -- '*.py'

> wizards/com/sun/star/wizards/common/Desktop.py:                sspecialchar = snewname.substring(i, i + 1)
> wizards/com/sun/star/wizards/common/FileAccess.py:            _sPath2 = _sPath2.substring(1)

Or is there some magic involved that makes a substring() method available in this case?

If not, and these actually are errors, in my opinion it is proof enough that nobody ever uses these wizards and they can be removed.

Steps to Reproduce:
.

Actual Results:  
.

Expected Results:
.


Reproducible: Always


User Profile Reset: No



Additional Info:


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/604.4.7 (KHTML, like Gecko) Version/11.0.2 Safari/604.4.7
Comment 1 How can I remove my account? 2018-01-19 19:38:24 UTC
Xisco, seems that you committed at least the Desktop.py in 2011
Comment 2 Xisco Faulí 2018-01-19 21:39:01 UTC
Hi Tor,
The reason why we have this in the python code is because I used a limited tool to convert the code from java to python and some methods were just not converted.
It doesn't fail because this code is not used by the agenda/fax/letter wizards but it's by the not-yet-converted java wizards
Comment 3 How can I remove my account? 2018-01-20 07:16:44 UTC
But why do we keep knowingly broken and unused machine-generated Python code in the master branch of the repo for seven years? It is just confusing. If at some time you or somebody works on this again, surely the converter tool can be run once more? Maybe the tool has even become better since?

The current situation is bad as it misleads people looking for Python code samples. Like I did. I am not 100% fluent in Python, but as I know the basics and it is such a nice language to work with, I usually manage fine by just grepping or googling for things I don't recall. So yesterday when I didn't remember how to take a substring in Python, I grepped as above, and didn't understand at all why Python claims the substring() method was wrong even if (as I thought) our code clearly ,uses it...

The very least, the file names should be changed to *.py.broken, or they should be put in a directory called python-wip-broken, or something similar to make it obvious it is not actual working code? But best would be to keep this only in a branch, I think.
Comment 4 QA Administrators 2019-01-21 03:39:51 UTC Comment hidden (obsolete)
Comment 5 How can I remove my account? 2019-02-15 09:16:39 UTC
Seems pointless to keep this open, let't WONTFIX it.