mantid
mantid copied to clipboard
Always add API import to top of file
Description of work. Set the cursor position to top of file to add API import Also remove check for import from future as Python2 not supported
To test:
save a python file locally with some text in the first few lines:
Rebin()
Load()
Rebin(again)
- open this file in the scripteditor in MantidWorkbench.
- Previously the import was added to the end (Or first empty line) but check it is now added to the top of the file.
Fixes #https://github.com/mantidproject/mantid/issues/34386
Reviewer
Please comment on the following (full description):
Code Review
- Is the code of an acceptable quality?
- Does the code conform to the coding standards?
- Are the unit tests small and test the class in isolation?
- If there is GUI work does it follow the GUI standards?
- If there are changes in the release notes then do they describe the changes appropriately?
- Are the release notes saved in a separate file, using Issue or PR number for file name and in the correct location?
Functional Tests
- Do changes function as described? Add comments below that describe the tests performed?
- Do the changes handle unexpected situations, e.g. bad input?
- Has the relevant (user and developer) documentation been added/updated?
Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers
will take care of it.