10-11-2019, 06:22 AM
(10-10-2019, 10:03 PM)carmen Wrote: Ofnuts--First: many, many thanks! Following your kind explanations, I have got the plugin installed and running. Maybe tomorrow I can post an example of its use (small fonts in maps / 'single path' fonts...)The substitution works in all cases. The PDB browser is you reference because it contains all the help for the plugins you installed, assuming the other put relevant strings in the registration data.
Now, you say
Quote:Use the Apply button in the PDB browser to get a Python-acceptable version of the call copied to the Python console.Well--although I have got Linux installed in an old laptop (unopened, alas! for months) I work chiefly in Win7, and my procedures browser doesn't include any gimp_..., but only gimp-... entries. I can only hope that a substitution of -/_ will cover most cases, it's one of those instance where I miss a cheat sheat!
Just discovered that the Apply button appears when one calls the PDB browser with phyton console opened.
(10-10-2019, 10:03 PM)carmen Wrote: New hitch: editing
toCode:
import sys
sys.stderr = open('G:/Tests/Gimp_plug/python-fu-output.txt','a')
sys.stdout=sys.stderr # So that they both go to the same file
made the plugin unaloadable:Code:
import sys
sys.stderr = open(os.path.devnull,'a')
Is there an alternative, or just comment out the call to traceback for normal use?Code:
Traceback (most recent call last):
File "G:\GimpResources\plug-ins\group-text2path.py", line 15, in <module>
sys.stderr = open(os.path.devnull,'a')
NameError: name 'os' is not defined
Thanks, gracias, merci...
You have to do import os before you can use os.
Personallu, I start my scripts with:
Code:
debug='OFN_DEBUG' in os.environ
def trace(s):
if debug:
print s
And I use the trace() instead of print in the code. trace() only prints something if the variable OFN_DEBUG is set in the environment, and this variable is set automatically in the terminal that is associated with my code editor.