Skip to content
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

Plugin validation: More than one top-level folder "allowed" #73

Closed
s-m-e opened this issue Apr 13, 2020 · 1 comment
Closed

Plugin validation: More than one top-level folder "allowed" #73

s-m-e opened this issue Apr 13, 2020 · 1 comment
Assignees
Labels
🕔 Size 5 It will take between half a day and a full day.

Comments

@s-m-e
Copy link

s-m-e commented Apr 13, 2020

If I understand the idea correctly, a plugin ZIP-file should have exactly one plugin top-level folder. Not more than one. If my understanding is correct, there is an issue in the validation: It only checks the "first" top level folder and does not care if there is more than one. (The current plugin installer in QGIS on the other hand also does not check if there is more than one sub-folder and just unpacks everything.)

    namelist = zip.namelist()
    try:
        package_name = namelist[0][:namelist[0].index('/')] # PROBLEMATIC SECTION
    except:
        raise ValidationError( _("Cannot find a folder inside the compressed package: this does not seems a valid plugin") )

    if package_name.endswith('/'):
        package_name = package_name[:-1]
    initname = package_name + '/__init__.py'
    metadataname = package_name + '/metadata.txt'

Relevant code in repository

@Xpirix Xpirix self-assigned this Jan 17, 2024
@Xpirix Xpirix added the 🕔 Size 5 It will take between half a day and a full day. label Jan 24, 2024
@Xpirix
Copy link
Collaborator

Xpirix commented Jan 25, 2024

Dear @s-m-e

It only checks the "first" top level folder and does not care if there is more than one

That's right, I suggest handling this with a non-blocking warning for now. Please find the proposed PR at #349

Regards

@Xpirix Xpirix closed this as completed May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕔 Size 5 It will take between half a day and a full day.
Projects
Development

No branches or pull requests

2 participants