New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModTool: Proper check on blockname before renaming #1847

Closed
wants to merge 1 commit into
base: next
from

Conversation

Projects
None yet
3 participants
@swap-nil7
Copy link
Contributor

swap-nil7 commented Jun 25, 2018

While renaming the blockname, there must be a valid check on the existence of blockname. This can be done by traversing the lib and python directories, getting a list of all blocknames and checking if this blockname exists. If it does not exists, we can give the user a list of suggested alternatives for his ease.
Moreover, this same list of blocknames can be beneficial for the Sequence Completer.
This method of generating the list of blocknames is more efficient than the one existing on the master branch script modtool_rm.py as it is python3 compatible. filter returns an object in python 3.
Fixes #1727

@swap-nil7

This comment has been minimized.

Copy link
Contributor

swap-nil7 commented Jun 25, 2018

And getting the first character of options.newname is not desirable.

@noc0lour

This comment has been minimized.

Copy link
Member

noc0lour commented Jun 25, 2018

@swap-nil7 can you rebase locally on origin/next, force push on your PR branch and rebase this PR?

@swap-nil7 swap-nil7 force-pushed the swap-nil7:pattern branch from e4e2a9c to 304feab Jun 25, 2018

@swap-nil7 swap-nil7 changed the base branch from python3 to next Jun 25, 2018

@mbr0wn

mbr0wn approved these changes Jun 25, 2018

@swap-nil7 swap-nil7 force-pushed the swap-nil7:pattern branch from 304feab to 130b9c3 Jun 28, 2018

@swap-nil7

This comment has been minimized.

Copy link
Contributor

swap-nil7 commented Jun 28, 2018

@mbr0wn: Updated this PR with py3k compatible SequenceCompleter and sequence completion of blocknames for remove, rename, makexml and disable modules.

ModTool: Add blockname check and SequenceCompleter
* Proper check on existence of blockname before removal
* Proper check on empty string for modules rm, makexml, disable
* Update SequenceCompleter for py3k compatibility
* Add Sequence Completer for rm, rename, makexml, disable

@swap-nil7 swap-nil7 force-pushed the swap-nil7:pattern branch from 130b9c3 to 4fdbaef Jun 29, 2018

@swap-nil7

This comment has been minimized.

Copy link
Contributor

swap-nil7 commented Jul 18, 2018

Closing the PR since the work is already there in #1873.

@swap-nil7 swap-nil7 closed this Jul 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment