ofn-preset-guides - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +--- Thread: ofn-preset-guides (/Thread-ofn-preset-guides) |
RE: ofn-preset-guides - EdoNork - 06-20-2021 Hi. Just tried. It works in one of my systems, but not in the other. The difference is that the second one has an "ñ" in the GIMP data path. RE: ofn-preset-guides - Ofnuts - 06-20-2021 Can Gimp write in that directory? The script creates a .log file when it registers (so you can track problem). So have you got an ofn-preset-guides.log file there and if so what are the contents (and have you got one in the version that works)? RE: ofn-preset-guides - teapot - 06-22-2021 Thank you for the update Ofnuts RE: ofn-preset-guides - rich2005 - 06-22-2021 Just wondering why some scripts start # -*- coding: iso-8859-15 -*- and others # -*- coding: utf-8 -*- I know one is for character sets and the other unicode but how is the choice made and why some scripts (not yours) just leave that line out ? RE: ofn-preset-guides - Ofnuts - 06-22-2021 In my scripts, depends which previous one I use to get started with the boiler plate. I tend to favor unicode, but still have a few ISO-8859 ones left. If there is nothing, it can work if your script is using only plain ASCII, or the default encoding defined for the system/user where it's running. In the case at hand, the ñ comes from data, not the code... RE: ofn-preset-guides - EdoNork - 06-26-2021 (06-20-2021, 07:12 PM)Ofnuts Wrote: Can Gimp write in that directory? The script creates a .log file when it registers (so you can track problem). So have you got an ofn-preset-guides.log file there and if so what are the contents (and have you got one in the version that works)? Hi, There is no .log file created. In the working system there is a log file, but in the second system there is not a non ASCII letters in the path. That's the only difference I can spot. This is not working: C:\Users\Iñigo\AppData\Roaming\GIMP\2.10\plug-ins\ofn-preset-guides RE: ofn-preset-guides - Ofnuts - 06-26-2021 Can you try this in the Python console (Filters ➤ Python-fu ➤ Console) Copy/paste all of this to the pyhon console (the leading spaces in the last line are important), and then strike enter until the prompt returns to ➤> Code: import os.path RE: ofn-preset-guides - EdoNork - 06-27-2021 import os.path File "<input>", line 1 rt os.path ^ SyntaxError: invalid syntax ➤> fname=os.path.join(gimp.directory,'testfile.dat') Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'os' is not defined ➤> print fname Traceback (most recent call last): File "<input>", line 1, in <module> NameError: name 'fname' is not defined ➤> with open(fname,'w') as dat: ... dat.write('Test successful') RE: ofn-preset-guides - Ofnuts - 06-27-2021 [quote] import os.path File "<input>", line 1 rt os.path ^ [/code] This is wrong, obviously the "import" was truncated, so the rest the command didn't do what I want. Can you retry with these three: Code: import os.path Code: fname=os.path.join(gimp.directory,'testfile.dat') Code: with open(fname,'w') as dat: And d'ont process tp the next of the previous one didn't work? RE: ofn-preset-guides - EdoNork - 07-01-2021 Sorry for the mistake. Here you have again: GIMP 2.10.24 Python Console Python 2.7.18 (default, Apr 20 2020, 16:57:11) [GCC 9.3.0 64 bit (AMD64)] ➤> import os.path ➤> fname=os.path.join(gimp.directory,'testfile.dat') ➤> print fname C:\Users\Iñigo\AppData\Roaming\GIMP\2.10\testfile.dat ➤> with open(fname,'w') as dat: ... dat.write('Test successful') ... Nothing is written in the plugins folder.. |