carol.gimp.org

gimp2

Python:mac proof

python

I have written plug-ins that read in the entire directory listing. The problem with sharing a plug-in that does this is that I never make file names with spaces in the name, therefore, my scripts never check for that.

A couple of python lines will ensure that your python plug-in can handle all sorts of file name inputs.

mac-proof

File   Edit   Search   Preferences




import string

def macproof_name(macname):
    rmspace = string.maketrans(" ","_")
    name = string.translate(macname, rmspace,'()#,?!\/*"<>|:;')
    name = string.lowercase(name)
    return name

# before you use this string as a file name 
    image_name = macproof_name(image_name)







  

another-gnu-type

Most all of my software is gnu. thanks!

Valid XHTML 1.1!

CC-GNU GPL
This software is licensed under the CC-GNU GPL.