Re: Problems using the PF_STRINGARRAY parameter type when writing a Python plugin for Gimp.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 22, 2018 at 8:17 PM, Craig Sanders <craig.sanders.gimp@xxxxxxxxx
> wrote:

> Hello.
>
> I'm trying to write a very basic plugin for Gimp using Python and I
> want its one and only parameter to be of type PF_STRINGARRAY. The goal
> of my plugin for the time being, is to receive a list of files, and
> then simply print their names on the Command line, when the plugin is
> run.
>

Huh. If I ever knew that PF_STRINGARRAY existed, it did not sink into the
gray matter much.

Try this, instead, perhaps.  It has the limitation of delivering all of the
files in the directory however:

Hmm, I have been doing this in two steps:

import os

def list_directory(directory):
    cennotts = os.listdir(directory)
    contents = sorted(cennotts)
    return contents

def list_directory_ext(directory, ext):
    total_contents = list_directory(directory)
    contents = []
    for content in total_contents:
    if content.endswith(ext):contents.append(content)
    return contents

They work with (PF_DIRNAME, "img_dir",   "Images directory", ""),

carol
_______________________________________________
gimp-developer-list mailing list
List address:    gimp-developer-list@xxxxxxxxx
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list



[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux