Missing self. reference. Fixes #115714.
2003-06-26 Manish Singh <yosh@gimp.org> * plug-ins/pygimp/gimpui.py: Missing self. reference. Fixes #115714. * plug-ins/pygimp/gimpui.py: Move item.show() in Selector so that all items are shown. Fixes bug #115715. Thanks to Dave Corrie for catching both these. * plug-ins/pygimp/gimpfu.py: Always register as type PLUGIN, to reflect the recent changes in semantics. * plug-ins/pygimp/plug-ins/gimpcons.py * plug-ins/pygimp/plug-ins/pdbbrowse.py: s/extension/plug_in/ to reflect above, for consistency. * plug-ins/pygimp/gimpfu.py: Add a fail method which uses gimp.message and then raises an error. * plug-ins/pygimp/gimpmodule.c: remove declarations for gimp_extension_ack and gimp_extension_process, they are in gimp.h. * plug-ins/pygimp/gimpfu.py * plug-ins/pygimp/gimpui.py * plug-ins/pygimp/plug-ins/gimpcons.py * plug-ins/pygimp/plug-ins/pdbbrowse.py: Added pygtk.require('2.0'). Fixes bug #115545.
This commit is contained in:

committed by
Manish Singh

parent
377d184946
commit
c1e165d32d
27
ChangeLog
27
ChangeLog
@ -1,3 +1,30 @@
|
|||||||
|
2003-06-26 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/pygimp/gimpui.py: Missing self. reference. Fixes #115714.
|
||||||
|
|
||||||
|
* plug-ins/pygimp/gimpui.py: Move item.show() in Selector so that all
|
||||||
|
items are shown. Fixes bug #115715. Thanks to Dave Corrie for catching
|
||||||
|
both these.
|
||||||
|
|
||||||
|
* plug-ins/pygimp/gimpfu.py: Always register as type PLUGIN, to
|
||||||
|
reflect the recent changes in semantics.
|
||||||
|
|
||||||
|
* plug-ins/pygimp/plug-ins/gimpcons.py
|
||||||
|
* plug-ins/pygimp/plug-ins/pdbbrowse.py: s/extension/plug_in/ to
|
||||||
|
reflect above, for consistency.
|
||||||
|
|
||||||
|
* plug-ins/pygimp/gimpfu.py: Add a fail method which uses
|
||||||
|
gimp.message and then raises an error.
|
||||||
|
|
||||||
|
* plug-ins/pygimp/gimpmodule.c: remove declarations for
|
||||||
|
gimp_extension_ack and gimp_extension_process, they are in gimp.h.
|
||||||
|
|
||||||
|
* plug-ins/pygimp/gimpfu.py
|
||||||
|
* plug-ins/pygimp/gimpui.py
|
||||||
|
* plug-ins/pygimp/plug-ins/gimpcons.py
|
||||||
|
* plug-ins/pygimp/plug-ins/pdbbrowse.py: Added pygtk.require('2.0').
|
||||||
|
Fixes bug #115545.
|
||||||
|
|
||||||
2003-06-28 Henrik Brix Andersen <brix@gimp.org>
|
2003-06-28 Henrik Brix Andersen <brix@gimp.org>
|
||||||
|
|
||||||
* app/gui/grid-dialog.c (cancel_callback): removed unneeded
|
* app/gui/grid-dialog.c (cancel_callback): removed unneeded
|
||||||
|
@ -135,7 +135,7 @@ def register(func_name, blurb, help, author, copyright, date, menupath,
|
|||||||
else:
|
else:
|
||||||
return 1
|
return 1
|
||||||
if not letterCheck(func_name):
|
if not letterCheck(func_name):
|
||||||
raise error, "function name contains ileagal characters"
|
raise error, "function name contains illegal characters"
|
||||||
for ent in params:
|
for ent in params:
|
||||||
if len(ent) < 4:
|
if len(ent) < 4:
|
||||||
raise error, "sequence not long enough for "+ent[0]
|
raise error, "sequence not long enough for "+ent[0]
|
||||||
@ -152,12 +152,11 @@ def register(func_name, blurb, help, author, copyright, date, menupath,
|
|||||||
raise error,"result name contains ilegal characters"
|
raise error,"result name contains ilegal characters"
|
||||||
if menupath[:8] == '<Image>/' or \
|
if menupath[:8] == '<Image>/' or \
|
||||||
menupath[:7] == '<Load>/' or \
|
menupath[:7] == '<Load>/' or \
|
||||||
menupath[:7] == '<Save>/':
|
menupath[:7] == '<Save>/' or \
|
||||||
|
menupath[:10] == '<Toolbox>/':
|
||||||
plugin_type = PLUGIN
|
plugin_type = PLUGIN
|
||||||
elif menupath[:10] == '<Toolbox>/':
|
|
||||||
plugin_type = EXTENSION
|
|
||||||
else:
|
else:
|
||||||
raise error, "menu path must start with <Image> or <Toolbox>"
|
raise error, "Invalid menu path"
|
||||||
|
|
||||||
if not func_name[:7] == 'python_' and \
|
if not func_name[:7] == 'python_' and \
|
||||||
not func_name[:10] == 'extension_' and \
|
not func_name[:10] == 'extension_' and \
|
||||||
@ -188,7 +187,7 @@ def _query():
|
|||||||
if plugin_type == PLUGIN:
|
if plugin_type == PLUGIN:
|
||||||
if menupath[:7] == '<Load>/':
|
if menupath[:7] == '<Load>/':
|
||||||
params[1:1] = file_params
|
params[1:1] = file_params
|
||||||
else:
|
elif menupath[:10] != '<Toolbox>/':
|
||||||
params.insert(1, (PDB_IMAGE, "image",
|
params.insert(1, (PDB_IMAGE, "image",
|
||||||
"The image to work on"))
|
"The image to work on"))
|
||||||
params.insert(2, (PDB_DRAWABLE, "drawable",
|
params.insert(2, (PDB_DRAWABLE, "drawable",
|
||||||
@ -233,6 +232,9 @@ def _interact(func_name):
|
|||||||
# short circuit for no parameters ...
|
# short circuit for no parameters ...
|
||||||
if len(params) == 0: return []
|
if len(params) == 0: return []
|
||||||
|
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
import gimpui
|
import gimpui
|
||||||
|
|
||||||
@ -242,6 +244,9 @@ def _interact(func_name):
|
|||||||
# define a mapping of param types to edit objects ...
|
# define a mapping of param types to edit objects ...
|
||||||
class StringEntry(gtk.Entry):
|
class StringEntry(gtk.Entry):
|
||||||
def __init__(self, default=''):
|
def __init__(self, default=''):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
gtk.Entry.__init__(self)
|
gtk.Entry.__init__(self)
|
||||||
self.set_text(str(default))
|
self.set_text(str(default))
|
||||||
@ -261,6 +266,8 @@ def _interact(func_name):
|
|||||||
class SliderEntry(gtk.HScale):
|
class SliderEntry(gtk.HScale):
|
||||||
# bounds is (upper, lower, step)
|
# bounds is (upper, lower, step)
|
||||||
def __init__(self, default=0, bounds=(0, 100, 5)):
|
def __init__(self, default=0, bounds=(0, 100, 5)):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
self.adj = gtk.Adjustment(default, bounds[0],
|
self.adj = gtk.Adjustment(default, bounds[0],
|
||||||
bounds[1], bounds[2],
|
bounds[1], bounds[2],
|
||||||
@ -271,6 +278,8 @@ def _interact(func_name):
|
|||||||
class SpinnerEntry(gtk.SpinButton):
|
class SpinnerEntry(gtk.SpinButton):
|
||||||
# bounds is (upper, lower, step)
|
# bounds is (upper, lower, step)
|
||||||
def __init__(self, default=0, bounds=(0, 100, 5)):
|
def __init__(self, default=0, bounds=(0, 100, 5)):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
self.adj = gtk.Adjustment(default, bounds[0],
|
self.adj = gtk.Adjustment(default, bounds[0],
|
||||||
bounds[1], bounds[2],
|
bounds[1], bounds[2],
|
||||||
@ -280,6 +289,8 @@ def _interact(func_name):
|
|||||||
return int(self.adj.value)
|
return int(self.adj.value)
|
||||||
class ToggleEntry(gtk.ToggleButton):
|
class ToggleEntry(gtk.ToggleButton):
|
||||||
def __init__(self, default=0):
|
def __init__(self, default=0):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
gtk.ToggleButton.__init__(self)
|
gtk.ToggleButton.__init__(self)
|
||||||
self.label = gtk.Label("No")
|
self.label = gtk.Label("No")
|
||||||
@ -296,6 +307,8 @@ def _interact(func_name):
|
|||||||
return self.get_active()
|
return self.get_active()
|
||||||
class RadioEntry(gtk.Frame):
|
class RadioEntry(gtk.Frame):
|
||||||
def __init__(self, default=0, items=(("Yes", 1), ("No", 0))):
|
def __init__(self, default=0, items=(("Yes", 1), ("No", 0))):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
gtk.Frame.__init__(self)
|
gtk.Frame.__init__(self)
|
||||||
box = gtk.HBox(gtk.FALSE, 5)
|
box = gtk.HBox(gtk.FALSE, 5)
|
||||||
@ -441,6 +454,11 @@ def main():
|
|||||||
'''This should be called after registering the plugin.'''
|
'''This should be called after registering the plugin.'''
|
||||||
gimp.main(None, None, _query, _run)
|
gimp.main(None, None, _query, _run)
|
||||||
|
|
||||||
|
def fail(msg):
|
||||||
|
'''Display and error message and quit'''
|
||||||
|
gimp.message(msg)
|
||||||
|
raise error, msg
|
||||||
|
|
||||||
_python_image = [
|
_python_image = [
|
||||||
"64 64 7 1",
|
"64 64 7 1",
|
||||||
" c #000000",
|
" c #000000",
|
||||||
@ -517,6 +535,8 @@ _python_image = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
def _get_logo(colormap):
|
def _get_logo(colormap):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
import gtk
|
import gtk
|
||||||
pix, mask = gtk.gdk.pixmap_colormap_create_from_xpm_d(None, colormap,
|
pix, mask = gtk.gdk.pixmap_colormap_create_from_xpm_d(None, colormap,
|
||||||
None, _python_image)
|
None, _python_image)
|
||||||
|
@ -669,9 +669,6 @@ pygimp_tile_height(PyObject *self)
|
|||||||
return PyInt_FromLong(gimp_tile_height());
|
return PyInt_FromLong(gimp_tile_height());
|
||||||
}
|
}
|
||||||
|
|
||||||
void gimp_extension_ack (void);
|
|
||||||
void gimp_extension_process (guint timeout);
|
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
pygimp_extension_ack(PyObject *self)
|
pygimp_extension_ack(PyObject *self)
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,9 @@ various gimp data types. Each of these selectors takes default as an argument
|
|||||||
to the constructor, and has a get_value() method for retrieving the result.
|
to the constructor, and has a get_value() method for retrieving the result.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk, gimp
|
import gtk, gimp
|
||||||
|
|
||||||
def _callbackWrapper(menu_item, callback, data):
|
def _callbackWrapper(menu_item, callback, data):
|
||||||
@ -188,7 +191,7 @@ class _Selector(gtk.HBox):
|
|||||||
|
|
||||||
swin = gtk.ScrolledWindow()
|
swin = gtk.ScrolledWindow()
|
||||||
swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
swin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
|
||||||
dialog.vbox.pack_start(swin)
|
self.dialog.vbox.pack_start(swin)
|
||||||
swin.show()
|
swin.show()
|
||||||
|
|
||||||
items = map(None, self.get_list())
|
items = map(None, self.get_list())
|
||||||
@ -202,7 +205,7 @@ class _Selector(gtk.HBox):
|
|||||||
list.add(item)
|
list.add(item)
|
||||||
if s == self.selected:
|
if s == self.selected:
|
||||||
list.select_child(item)
|
list.select_child(item)
|
||||||
item.show()
|
item.show()
|
||||||
swin.add_with_viewport(list)
|
swin.add_with_viewport(list)
|
||||||
list.show()
|
list.show()
|
||||||
|
|
||||||
|
@ -19,13 +19,19 @@
|
|||||||
|
|
||||||
from gimpfu import *
|
from gimpfu import *
|
||||||
|
|
||||||
def extension_python_fu_console():
|
def plug_in_python_fu_console():
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk, gimpenums, gimpshelf
|
import gtk, gimpenums, gimpshelf
|
||||||
|
|
||||||
gtk.rc_parse(gimp.gtkrc())
|
gtk.rc_parse(gimp.gtkrc())
|
||||||
|
|
||||||
namespace = {'__builtins__': __builtins__,
|
namespace = {'__builtins__': __builtins__,
|
||||||
'__name__': '__main__', '__doc__': None,
|
'__name__': '__main__', '__doc__': None,
|
||||||
'gimp': gimp, 'pdb': gimp.pdb,
|
'gimp': gimp, 'pdb': gimp.pdb,
|
||||||
'shelf': gimpshelf.shelf}
|
'shelf': gimpshelf.shelf}
|
||||||
|
|
||||||
for s in gimpenums.__dict__.keys():
|
for s in gimpenums.__dict__.keys():
|
||||||
if s[0] != '_':
|
if s[0] != '_':
|
||||||
namespace[s] = getattr(gimpenums, s)
|
namespace[s] = getattr(gimpenums, s)
|
||||||
@ -38,15 +44,21 @@ def extension_python_fu_console():
|
|||||||
cons = gtkcons.Console(namespace=namespace, quit_cb=gtk.mainquit)
|
cons = gtkcons.Console(namespace=namespace, quit_cb=gtk.mainquit)
|
||||||
|
|
||||||
def browse(button, cons):
|
def browse(button, cons):
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk, pdbbrowse
|
import gtk, pdbbrowse
|
||||||
|
|
||||||
def ok_clicked(button, browse, cons=cons):
|
def ok_clicked(button, browse, cons=cons):
|
||||||
cons.line.set_text(browse.cmd)
|
cons.line.set_text(browse.cmd)
|
||||||
browse.destroy()
|
browse.destroy()
|
||||||
|
|
||||||
win = pdbbrowse.BrowseWin(ok_button=ok_clicked)
|
win = pdbbrowse.BrowseWin(ok_button=ok_clicked)
|
||||||
win.connect("destroy", gtk.mainquit)
|
win.connect("destroy", gtk.mainquit)
|
||||||
win.set_modal(TRUE)
|
win.set_modal(TRUE)
|
||||||
win.show()
|
win.show()
|
||||||
gtk.mainloop()
|
gtk.mainloop()
|
||||||
|
|
||||||
button = gtk.Button("Browse")
|
button = gtk.Button("Browse")
|
||||||
button.connect("clicked", browse, cons)
|
button.connect("clicked", browse, cons)
|
||||||
cons.inputbox.pack_end(button, expand=FALSE)
|
cons.inputbox.pack_end(button, expand=FALSE)
|
||||||
@ -56,10 +68,12 @@ def extension_python_fu_console():
|
|||||||
win.set_default_size(475, 300)
|
win.set_default_size(475, 300)
|
||||||
win.show()
|
win.show()
|
||||||
cons.init()
|
cons.init()
|
||||||
|
|
||||||
# flush the displays every half second
|
# flush the displays every half second
|
||||||
def timeout():
|
def timeout():
|
||||||
gimp.displays_flush()
|
gimp.displays_flush()
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
gtk.timeout_add(500, timeout)
|
gtk.timeout_add(500, timeout)
|
||||||
gtk.mainloop()
|
gtk.mainloop()
|
||||||
|
|
||||||
@ -74,6 +88,6 @@ register(
|
|||||||
"*",
|
"*",
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
extension_python_fu_console)
|
plug_in_python_fu_console)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
@ -30,6 +30,9 @@ for i in pars:
|
|||||||
del pars, i
|
del pars, i
|
||||||
|
|
||||||
def define_browse_win():
|
def define_browse_win():
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
global BrowseWin
|
global BrowseWin
|
||||||
@ -288,14 +291,22 @@ def define_browse_win():
|
|||||||
map(lambda x: x[1], params), ', ') + ")"
|
map(lambda x: x[1], params), ', ') + ")"
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
def extension_pdb_browse():
|
def plug_in_pdb_browse():
|
||||||
|
import pygtk
|
||||||
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
gtk.rc_parse(gimp.gtkrc())
|
gtk.rc_parse(gimp.gtkrc())
|
||||||
|
|
||||||
define_browse_win()
|
define_browse_win()
|
||||||
|
|
||||||
win = BrowseWin()
|
win = BrowseWin()
|
||||||
win.connect("destroy", gtk.mainquit)
|
win.connect("destroy", gtk.mainquit)
|
||||||
win.show()
|
win.show()
|
||||||
|
|
||||||
gtk.mainloop()
|
gtk.mainloop()
|
||||||
|
|
||||||
register(
|
register(
|
||||||
"python_fu_pdb_browse",
|
"python_fu_pdb_browse",
|
||||||
"Browse the Procedural Database",
|
"Browse the Procedural Database",
|
||||||
@ -307,7 +318,9 @@ if __name__ == '__main__':
|
|||||||
"*",
|
"*",
|
||||||
[],
|
[],
|
||||||
[],
|
[],
|
||||||
extension_pdb_browse)
|
plug_in_pdb_browse)
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
define_browse_win()
|
define_browse_win()
|
||||||
|
Reference in New Issue
Block a user