carol.gimp.org

gimp2

Python:windows 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.

window-proof

File   Edit   Search   Preferences




import string

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

# before you use this string as a file name 
    image_name = windowsproof_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.