Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python-fu path of the plug-ins folder
#2
There isn't one single folder, there are "folders", so nothing says that the folder you are looking at is the right one (I use three additional folders besides the standard two, and furthermore they mostly contain soft links to script elsewhere.

If you want to know where your plugin is, use os.path.abspath(sys.argv[0]) (this is the full path to your plugin file..).

Code:
#!/usr/bin/env python
import os,sys
from gimpfu import *

def whoIam(case=None):
    me=sys.argv[0]
    case="Execution" if case is None else case
    print "----\n%s:\nsys.argv[0]=%s\nAbsolute=%s\nReal=%s" % (case,me,os.path.abspath(me),os.path.realpath(me))

whoIam(case='Initialization')

register(
    "whoiam","Who I am","Who I am", "", "", "", "WhoIAm","",[],[],whoIam,menu="<Image>/Test/"
)
main()
The code above will show you that your plugin code is fully executed everytime (you get the "Iniialization" output, besides the one called as the actual plugin function).
Reply


Messages In This Thread
RE: Python-fu path of the plug-ins folder - by Ofnuts - 01-11-2019, 12:13 PM

Forum Jump: