Source

python-fu-dump / dump.py

Full commit
from gimpfu import *
import gtk
import os
import collections
import ctypes

def get_dir() :
        MessageBox = ctypes.windll.user32.MessageBoxA
        response = ""

        # Check for new pygtk: this is new class in PyGtk 2.4
        if (gtk.pygtk_version < (2,3,90)) :
                MessageBox(None, "This plugin requires PyGtk 2.3.90 or later", "Error", 0)
                return response

        dialog = gtk.FileChooserDialog(
                "Dump to...",
                None,
                gtk.FILE_CHOOSER_ACTION_OPEN,
                (
                        gtk.STOCK_CANCEL,
                        gtk.RESPONSE_CANCEL,
                        gtk.STOCK_OPEN,
                        gtk.RESPONSE_OK
                )
        )
        dialog.set_default_response(gtk.RESPONSE_OK)
        dialog.set_action(gtk.FILE_CHOOSER_ACTION_SELECT_FOLDER)

        if (dialog.run() == gtk.RESPONSE_OK) :
                response = dialog.get_filename()
        dialog.destroy()

        return response

def dump_pdb() :
        MessageBox = ctypes.windll.user32.MessageBoxA

        ofstr = get_dir()
        if("" == ofstr) :
                return None

        MessageBox(None, "directory:%s"%ofstr, "Your moms a rabbit", 0)


        return None

register(
        #name
        "dump-pdb",
        #blurb
        "dumps pdb database to HTML",
        #help
        "man up buttercup",
        #author
        "codefox",
        #copyright
        "MIT license => rtfm",
        #date
        "Jan 29, 2013",
        #menu path
        "<Toolbox>/Help/Procedure Dump",
        #image types
        None,
        #params
        [
        ],
        #results
        [],
        #function
        dump_pdb
)

main()