rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
(PF_RADIO, "image_extension", "The format of the images: {gif, jpg, png}", "gif", (("gif", "gif"), ("jpg", "jpg"), ("png", "png"))), (PF_TOGGLE, "separate_image_dir", "Use a separate directory for images?", False), (PF_STRING, "relative_image_path", "The path to export the images to, relative to the Save Path", "images... | (PF_RADIO, "image_extension", "The format of the images: {gif, jpg, png}", "gif", (("gif", "gif"), ("jpg", "jpg"), ("png", "png"))), (PF_TOGGLE, "separate_image_dir", "Use a separate directory for images?", False), (PF_STRING, "relative_image_path", "The path where to export the" + " images, relative to the Save Path",... | def cell(self, src, width, height): out = ('\t\t<td><img alt=" " src="%%s" width="%d" height="%d"></td>' % (width, height)) self.write(out, src) |
print 'void %s(GimpCompositeContext *);' % (function_table[key][0]) | print 'GimpCompositeFunction %s();' % (function_table[key][0]) | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print 'void %s(GimpCompositeContext *);' % (function_tabl... |
print 'extern void %s(GimpCompositeContext *);' % ("gimp_composite_unsupported") | print 'extern GimpCompositeFunction %s();' % ("gimp_composite_unsupported") | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print 'extern void %s(GimpCompositeContext *);' % (f[0]) | print 'extern GimpCompositeFunction %s();' % (f[0]) | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print 'extern GimpCompositeFunction %s;' % ("gimp_composite_unsupported") | print 'extern GimpCompositeFunction %s();' % ("gimp_composite_unsupported") | print >>fpout, 'typedef GimpCompositeFunction (*GimpCompositeFunctionTable[%s][%s][%s][%s]);' % ("GIMP_COMPOSITE_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N") |
op.add_option('-n', '--n-pixels', action='store', type="int", dest='n_pixels', default=128*8192+16+1, | op.add_option('-n', '--n-pixels', action='store', type="int", dest='n_pixels', default=1024*8192+16+1, | def gimp_composite_cfile(fpout, name, function_table, requirements=[]): print >>fpout, '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */' print >>fpout, '/* REGENERATE BY USING make-installer.py */' print >>fpout, '#include "config.h"' print >>fpout, '#include <glib-object.h>' print >>fpout, '#include <stdlib.h... |
bounds[2], bounds[2]) | bounds[2], 0) | def __init__(self, default=0, bounds=(0, 100, 5)): self.adj = gtk.Adjustment(default, bounds[0], bounds[1], bounds[2], bounds[2], bounds[2]) gtk.HScale.__init__(self, self.adj) |
bounds[2], bounds[2]) | bounds[2], 0) | def __init__(self, default=0, bounds=(0, 100, 5)): self.adj = gtk.Adjustment(default, bounds[0], bounds[1], bounds[2], bounds[2], bounds[2]) gtk.SpinButton.__init__(self, self.adj, 1, 0) |
(PF_SLIDER, "light", "light angle", 45, (0,360,1)), (PF_TOGGLE, "shadow", "shadow?", 1), (PF_COLOR, "bg_colour", "background", (255,255,255)), (PF_COLOR, "sphere_colour", "sphere", (255,0,0)) | (PF_SLIDER, "light", "Light angle", 45, (0,360,1)), (PF_TOGGLE, "shadow", "Shadow?", 1), (PF_COLOR, "bg_colour", "Background", (255,255,255)), (PF_COLOR, "sphere_colour", "Sphere", (255,0,0)) | def python_sphere(radius, light, shadow, bg_colour, sphere_colour): if radius < 1: radius = 1 width = int(radius * 3.75) height = int(radius * 2.5) img = gimp.Image(width, height, RGB) drawable = gimp.Layer(img, "Sphere Layer", width, height, RGB_IMAGE, 100, NORMAL_MODE) radians = light * math.pi / 180 cx = width ... |
(PF_STRING, "save_path", "The path to export the HTML to", os.getcwd()), | (PF_DIRNAME, "save_path", "The path to export the HTML to", os.getcwd()), | def parse_urls (self): """ This will parse any url targets in the href="XX" fields of the given file and return then as a list """ import re url_list = [] try: html_file = open (self.filename) #Regular expression to pick everything up to the next doublequote #character after finding the sequence 'href="'. The found ... |
if run_mode != RUN_NONINTERACTIVE: gimp.displays_flush() | if run_mode != RUN_NONINTERACTIVE: gimp.displays_flush() return res | def _run(func_name, params): run_mode = params[0] plugin_type = _registered_plugins_[func_name][7] menupath = _registered_plugins_[func_name][5] func = _registered_plugins_[func_name][10] if plugin_type == PLUGIN and menupath[:10] != '<Toolbox>/': if menupath[:7] == '<Save>/': end = 5 else: end = 3 start_params = par... |
image = pdb.gimp_file_load (RUN_NONINTERACTIVE, image_name, image_name) | image = pdb.gimp_file_load (image_name, image_name) | def benchmark (folder, save_output): folder = os.path.abspath (folder) if not os.path.exists (folder): gimp.message("Folder '" + folder + "' doesn't exist.\n") return; total_unclassified = 0 total_misclassified = 0 total_time = 0.0 images = os.path.join (folder, "images") for name in os.listdir (images): try: gimp.d... |
mask = pdb.gimp_file_load (RUN_NONINTERACTIVE, mask_name, mask_name) | mask = pdb.gimp_file_load (mask_name, mask_name) | def benchmark (folder, save_output): folder = os.path.abspath (folder) if not os.path.exists (folder): gimp.message("Folder '" + folder + "' doesn't exist.\n") return; total_unclassified = 0 total_misclassified = 0 total_time = 0.0 images = os.path.join (folder, "images") for name in os.listdir (images): try: gimp.d... |
truth = pdb.gimp_file_load (RUN_NONINTERACTIVE, truth_name, truth_name) | truth = pdb.gimp_file_load (truth_name, truth_name) | def benchmark (folder, save_output): folder = os.path.abspath (folder) if not os.path.exists (folder): gimp.message("Folder '" + folder + "' doesn't exist.\n") return; total_unclassified = 0 total_misclassified = 0 total_time = 0.0 images = os.path.join (folder, "images") for name in os.listdir (images): try: gimp.d... |
pdb.gimp_file_save (RUN_NONINTERACTIVE, mask, mask_layer, filename, filename) | pdb.gimp_file_save (mask, mask_layer, filename, filename) | def benchmark (folder, save_output): folder = os.path.abspath (folder) if not os.path.exists (folder): gimp.message("Folder '" + folder + "' doesn't exist.\n") return; total_unclassified = 0 total_misclassified = 0 total_time = 0.0 images = os.path.join (folder, "images") for name in os.listdir (images): try: gimp.d... |
if len(vert) == 0 or len(horz) == 0: | if len(vert) == 0 and len(horz) == 0: | def pyslice(image, drawable, save_path, html_filename, image_basename, image_extension, separate, image_path, capitalize, cellspacing): vert, horz = get_guides(image) if len(vert) == 0 or len(horz) == 0: return gimp.progress_init("Py-Slice") progress_increment = 1 / ((len(horz) + 1) * (len(vert) + 1)) progress = 0.0... |
if not os.path.isdir(path): | if not os.path.exists(path): | def check_path(path): path = os.path.abspath(path) |
tw.cell(src, right - left, bottom - top) | if image_relative_path: if image_relative_path.endswith('/'): src_path = image_relative_path + src else: src_path = image_relative_path + '/' + src else: src_path = src tw.cell(src_path, right - left, bottom - top) | def check_path(path): path = os.path.abspath(path) |
(PF_STRING, "save_path", "The path to export the HTML to", "/tmp"), | (PF_STRING, "save_path", "The path to export the HTML to", os.getcwd()), | def cell(self, src, width, height): out = ('\t\t<td><img alt=" " src="%%s" width="%d" height="%d"></td>' % (width, height)) self.write(out, src) |
self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | if default == None: self.selected = self.menu.children()[0].get_data("Gimp-ID") self.set_history (0) else: self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | def __init__(self, default=None): gtk.OptionMenu.__init__(self) self.menu = ImageMenu(None, self.clicked) self.set_menu(self.menu) self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break |
self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | if default == None: self.selected = self.menu.children()[0].get_data("Gimp-ID") self.set_history (0) else: self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | def __init__(self, default=None): gtk.OptionMenu.__init__(self) self.menu = LayerMenu(None, self.clicked) self.set_menu(self.menu) self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break |
self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | if default == None: self.selected = self.menu.children()[0].get_data("Gimp-ID") self.set_history (0) else: self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | def __init__(self, default=None): gtk.OptionMenu.__init__(self) self.menu = ChannelMenu(None, self.clicked) self.set_menu(self.menu) self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break |
self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | if default == None: self.selected = self.menu.children()[0].get_data("Gimp-ID") self.set_history (0) else: self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break | def __init__(self, default=None): gtk.OptionMenu.__init__(self) self.menu = DrawableMenu(None, self.clicked) self.set_menu(self.menu) self.selected = default children = self.menu.children() for child in range(len(children)): if children[child].get_data("Gimp-ID") == default: self.set_history(child) break |
"Evaulate python code under the python interpreter (primarily for batch mode)", | "Evaluate python code under the python interpreter (primarily for batch mode)", | def code_eval(code): if code == '-': import sys code = sys.stdin exec code |
items.append((img.filename, img)) | if not img.filename: filename = img.name else: filename = img.filename items.append((filename, img)) | def ImageMenu(constraint=None, callback=None, data=None): items = [] for img in gimp.image_list(): if constraint and not constraint(img): continue items.append((img.filename, img)) items.sort() return _createMenu(items, callback, data) |
print "/* $Id$ */" | print ' print ' print ' | def gimp_composite_init(function_tables): for o in function_tables: print "extern void %s_init();" % (functionnameify(o[0])) pass print "" print """ |
dlg.format_secondary_text( "".join( traceback.format_exception_only(sys.exc_type, sys.exc_value) ) ) | dlg.format_secondary_text(exc_only_str) | def error_dialog(parent, proc_name): import sys, traceback title = _("An error occured running %s") % proc_name dlg = gtk.MessageDialog(parent, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, title) dlg.format_secondary_text( "".join( traceback.format_exception_only(sys.exc_type, sys.exc_value) ) ... |
label = gtk.Label(traceback.format_exc()); | label = gtk.Label(exc_str) | def error_dialog(parent, proc_name): import sys, traceback title = _("An error occured running %s") % proc_name dlg = gtk.MessageDialog(parent, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, title) dlg.format_secondary_text( "".join( traceback.format_exception_only(sys.exc_type, sys.exc_value) ) ... |
self.set_active(default) def get_value(self): return self.get_active() | self.set_active_image(default) def get_value(self): return self.get_active_image() | def __init__(self, default=None): ImageComboBox.__init__(self) if default is not None: self.set_active(default) |
self.set_active(default) def get_value(self): return self.get_active() | self.set_active_layer(default) def get_value(self): return self.get_active_layer() | def __init__(self, default=None): LayerComboBox.__init__(self) if default is not None: self.set_active(default) |
self.set_active(default) def get_value(self): return self.get_active() | self.set_active_channel(default) def get_value(self): return self.get_active_channel() | def __init__(self, default=None): ChannelComboBox.__init__(self) if default is not None: self.set_active(default) |
self.set_active(default) def get_value(self): return self.get_active() | self.set_active_drawable(default) def get_value(self): return self.get_active_drawable() | def __init__(self, default=None): DrawableComboBox.__init__(self) if default is not None: self.set_active(default) |
self.set_active(default) def get_value(self): return self.get_active() | self.set_active_vectors(default) def get_value(self): return self.get_active_vectors() | def __init__(self, default=None): VectorsComboBox.__init__(self) if default is not None: self.set_active(default) |
features.append('cpu & CPU_ACCEL_%s' % f) | features.append('cpu & GIMP_CPU_ACCEL_%s' % f) | def gimp_composite_installer_install3(fpout, name, requirements=[], cpu_feature=[]): if not requirements and not cpu_feature: return print >>fpout, '' print >>fpout, 'gboolean' print >>fpout, '%s_init (void)' % (functionnameify(name)) print >>fpout, '{' need_endif = False for r in requirements: print >>fpout, '#if %... |
print >>fpout, ' guint32 cpu = cpu_accel ();' | print >>fpout, ' GimpCpuAccelFlags cpu = gimp_cpu_accel_get_support ();' | def gimp_composite_installer_install3(fpout, name, requirements=[], cpu_feature=[]): if not requirements and not cpu_feature: return print >>fpout, '' print >>fpout, 'gboolean' print >>fpout, '%s_init (void)' % (functionnameify(name)) print >>fpout, '{' need_endif = False for r in requirements: print >>fpout, '#if %... |
feature_test = 'cpu_accel () & CPU_ACCEL_%s' % cpu_feature[0] | feature_test = 'gimp_cpu_accel_get_support () & GIMP_CPU_ACCEL_%s' % cpu_feature[0] | def gimp_composite_installer_install3(fpout, name, requirements=[], cpu_feature=[]): if not requirements and not cpu_feature: return print >>fpout, '' print >>fpout, 'gboolean' print >>fpout, '%s_init (void)' % (functionnameify(name)) print >>fpout, '{' need_endif = False for r in requirements: print >>fpout, '#if %... |
print >>fpout, ' | def gimp_composite_cfile(fpout, name, function_table, requirements=[], cpu_feature=[]): print >>fpout, '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */' print >>fpout, '/* REGENERATE BY USING make-installer.py */' print >>fpout, '#include "config.h"' print >>fpout, '#include <glib-object.h>' print >>fpout, '#i... | |
if cpu_feature: print >>fpout, ' | def gimp_composite_cfile(fpout, name, function_table, requirements=[], cpu_feature=[]): print >>fpout, '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */' print >>fpout, '/* REGENERATE BY USING make-installer.py */' print >>fpout, '#include "config.h"' print >>fpout, '#include <glib-object.h>' print >>fpout, '#i... | |
self.entry = gtk.Entry() self.pack_start(self.entry) self.entry.show() self.button = gtk.Button("...") self.button.connect("clicked", self.show_dialog) self.pack_start(self.button, expand=False) | self.button = gtk.FileChooserButton("Pick a file") self.pack_start(self.button, False, False, 6) self.button.set_filename (default) | def __init__(self, default=""): gtk.HBox.__init__(self, False, 5) self.entry = gtk.Entry() self.pack_start(self.entry) self.entry.show() self.button = gtk.Button("...") self.button.connect("clicked", self.show_dialog) self.pack_start(self.button, expand=False) self.button.show() |
self.dialog = gtk.FileSelection("Files") self.dialog.set_default_size(400, 300) def delete_event(win, event): win.hide() return True self.dialog.connect("delete_event", delete_event) self.dialog.set_filename(default) self.selected = self.dialog.get_filename() self.entry.set_text(self.selected) | def __init__(self, default=""): gtk.HBox.__init__(self, False, 5) self.entry = gtk.Entry() self.pack_start(self.entry) self.entry.show() self.button = gtk.Button("...") self.button.connect("clicked", self.show_dialog) self.pack_start(self.button, expand=False) self.button.show() | |
print 'static int gimp_composite_initialised = 0;' print 'void' print 'gimp_composite_init()' print '{' print 'if (!gimp_composite_initialised) {' for o in objects: print ' %s_init();' % (functionnameify(o.filename)) pass print ' gimp_composite_initialised = 1;' print ' }' print '}' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... | |
print 'static int gimp_composite_initialised = 0;' print '' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'static int gimp_composite_initialised = 0;' print '' print 'void' print 'gimp_composite_init()' print '{' print ' if (!gimp_composite_initialised) {' for o in function_tab... | |
print ' if (!gimp_composite_initialised) {' | print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' print ' g_printerr("Using new image composite functions\n");' print ' }' print '' print ' if (!gimp_composite_options.initialised) {' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'static int gimp_composite_initialised = 0;' print '' print 'void' print 'gimp_composite_init()' print '{' print ' if (!gimp_composite_initialised) {' for o in function_tab... |
print ' gimp_composite_initialised = 1;' | print ' gimp_composite_options.initialised = 1;' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'static int gimp_composite_initialised = 0;' print '' print 'void' print 'gimp_composite_init()' print '{' print ' if (!gimp_composite_initialised) {' for o in function_tab... |
print "void %s(GimpCompositeContext *);" % (function_table[key][0]) | print 'void %s(GimpCompositeContext *);' % (function_table[key][0]) | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print "" print "void (*%s[%d][%d][%d][%d])() = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) | print '' print 'GimpCompositeFunction (*%s[%s][%s][%s][%s])() = {' % (functionnameify(filename), "GIMP_COMPOSITE_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N") | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print " { /* %s */" % (mode) | print ' { /* %s */' % (mode) | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print " { /* A = %s */" % (pixel_depth_name(A)) | print ' { /* A = %s */' % (pixel_depth_name(A)) | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print " /* %-6s */ {" % (pixel_depth_name(B)), | print ' /* %-6s */ {' % (pixel_depth_name(B)), | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print "%s, " % (function_table[key][0]), | print '%s, ' % (function_table[key][0]), | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print "%s, " % ("NULL"), pass pass print "}," pass print " }," pass print " }," pass print "};\n" | print '%s, ' % ("NULL"), pass pass print '},' pass print ' },' pass print ' },' pass print '};\n' | def print_function_table(filename, function_table): function_table_declarations = dict() function_table_keys = function_table.keys() function_table_keys.sort() for key in function_table_keys: if not function_table_declarations.has_key(function_table[key][0]): print "void %s(GimpCompositeContext *);" % (function_tabl... |
print "" print "char *%s_name[%d][%d][%d][%d] = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) | print '' print 'char *%s_name[%s][%s][%s][%s] = {' % (functionnameify(filename), "GIMP_COMPOSITE_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N", "GIMP_PIXELFORMAT_N") | def print_function_table_name(filename, function_table): print "" print "char *%s_name[%d][%d][%d][%d] = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) for mode in composite_modes: print " { /* %s */" % (mode) for A in filter(lambda pf: pf != "GIMP... |
print " { /* %s */" % (mode) | print ' { /* %s */' % (mode) | def print_function_table_name(filename, function_table): print "" print "char *%s_name[%d][%d][%d][%d] = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) for mode in composite_modes: print " { /* %s */" % (mode) for A in filter(lambda pf: pf != "GIMP... |
print " { /* A = %s */" % (pixel_depth_name(A)) | print ' { /* A = %s */' % (pixel_depth_name(A)) | def print_function_table_name(filename, function_table): print "" print "char *%s_name[%d][%d][%d][%d] = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) for mode in composite_modes: print " { /* %s */" % (mode) for A in filter(lambda pf: pf != "GIMP... |
print " /* %-6s */ {" % (pixel_depth_name(B)), | print ' /* %-6s */ {' % (pixel_depth_name(B)), | def print_function_table_name(filename, function_table): print "" print "char *%s_name[%d][%d][%d][%d] = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) for mode in composite_modes: print " { /* %s */" % (mode) for A in filter(lambda pf: pf != "GIMP... |
print "}," pass print " }," pass print " }," pass print "};\n" | print '},' pass print ' },' pass print ' },' pass print '};\n' | def print_function_table_name(filename, function_table): print "" print "char *%s_name[%d][%d][%d][%d] = {" % (functionnameify(filename), len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) for mode in composite_modes: print " { /* %s */" % (mode) for A in filter(lambda pf: pf != "GIMP... |
print "/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */" print "$Id$" | print '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */' print '$Id$' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print "extern void %s(GimpCompositeContext *);" % ("gimp_composite_unsupported") | print 'extern void %s(GimpCompositeContext *);' % ("gimp_composite_unsupported") | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print "extern void %s(GimpCompositeContext *);" % (f[0]) | print 'extern void %s(GimpCompositeContext *);' % (f[0]) | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print "char *gimp_composite_function_name[%d][%d][%d][%d] = {" % (len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) | print 'char *gimp_composite_function_name[%d][%d][%d][%d] = {' % (len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " {" | print ' {' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " {", | print ' {', | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print "}," pass print " }," | print '},' pass print ' },' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " }," pass print "};" pass print "" print "void (*gimp_composite_function[%d][%d][%d][%d])() = {" % (len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) | print ' },' pass print '};' pass print '' print 'void (*gimp_composite_function[%d][%d][%d][%d])() = {' % (len(composite_modes), len(pixel_format)-1, len(pixel_format)-1, len(pixel_format)-1) | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " { /* %s */" % (mode) | print ' { /* %s */' % (mode) | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " { /* A = %s */" % (pixel_depth_name(A)) | print ' { /* A = %s */' % (pixel_depth_name(A)) | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " /* %s */ {" % (pixel_depth_name(B)), | print ' /* %s */ {' % (pixel_depth_name(B)), | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print "%s, " % (gimp_composite_function[key][0]), | print '%s, ' % (gimp_composite_function[key][0]), | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print "%s, " % ("gimp_composite_unsupported"), pass pass print "}," pass print " }," | print '%s, ' % ("gimp_composite_unsupported"), pass pass print '},' pass print ' },' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " }," pass print "};" print """ static int gimp_composite_initialised = 0; void gimp_composite_init() { if (!gimp_composite_initialised) { """ | print ' },' pass print '};' print 'static int gimp_composite_initialised = 0;' print 'void' print 'gimp_composite_init()' print '{' print 'if (!gimp_composite_initialised) {' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print " %s_init();" % (functionnameify(o.filename)) pass print " gimp_composite_initialised = 1;" print " }" print "}" | print ' %s_init();' % (functionnameify(o.filename)) pass print ' gimp_composite_initialised = 1;' print ' }' print '}' | def main(argv): objects = map(ns.nmx, argv) objs = objects objs.reverse() gimp_composite_function = dict() for o in objs: for mode in composite_modes: for A in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for B in filter(lambda pf: pf != "GIMP_PIXELFORMAT_ANY", pixel_format): for D in filter(lambda... |
print """ void gimp_composite_regression() { GimpCompositeContext generic_ctx; GimpCompositeContext special_ctx; """ | print 'void' print 'gimp_composite_regression()' print '{' print ' GimpCompositeContext generic_ctx;' print ' GimpCompositeContext special_ctx;' | def gimp_composite_regression(function_tables): print """ |
print "" print " special_ctx.op = %s;" % (mode) print " generic_ctx.op = %s;" % (mode) print " %s(&special_ctx);" % (f[1][key][0]) print " %s(&generic_ctx);" % (generic_table[key][0]) | print '' print ' special_ctx.op = %s;' % (mode) print ' generic_ctx.op = %s;' % (mode) print ' %s(&special_ctx);' % (f[1][key][0]) print ' %s(&generic_ctx);' % (generic_table[key][0]) | def gimp_composite_regression(function_tables): print """ |
print """ } """ | print '}' | def gimp_composite_regression(function_tables): print """ |
print "extern void %s_init();" % (functionnameify(o[0])) pass print "" print """ static int gimp_composite_initialised = 0; void gimp_composite_init() { if (!gimp_composite_initialised) { """ | print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'static int gimp_composite_initialised = 0;' print '' print 'void' print 'gimp_composite_init()' print '{' print ' if (!gimp_composite_initialised) {' | def gimp_composite_init(function_tables): for o in function_tables: print "extern void %s_init();" % (functionnameify(o[0])) pass print "" print """ |
print " %s_init();" % (functionnameify(o[0])) pass print " gimp_composite_initialised = 1;" print " }" print "}" | print ' %s_init();' % (functionnameify(o[0])) pass print ' gimp_composite_initialised = 1;' print ' }' print '}' | def gimp_composite_init(function_tables): for o in function_tables: print "extern void %s_init();" % (functionnameify(o[0])) pass print "" print """ |
print "/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */" | def gimp_composite_hfile(fpout): print >>fpout, '/* THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT */' print >>fpout, '' print >>fpout, 'typedef void (*GimpCompositeFunction)(GimpCompositeContext *);' print >>fpout, 'typedef GimpCompositeFunction (*GimpCompositeFunctionTable[%s][%s][%s][%s]);' % ("GIMP_COMPOSITE_N"... | def gimp_composite_init(function_tables): for o in function_tables: print "extern void %s_init();" % (functionnameify(o[0])) pass print "" print """ |
print "extern void %s(GimpCompositeContext *);" % ("gimp_composite_unsupported") print "" | print ' print 'extern GimpCompositeFunction %s;' % ("gimp_composite_unsupported") print '' | def gimp_composite_init(function_tables): for o in function_tables: print "extern void %s_init();" % (functionnameify(o[0])) pass print "" print """ |
apply(getattr(self, name), params) | return apply(getattr(self, name), params) | def _run(self, name, params): if hasattr(self, name): apply(getattr(self, name), params) else: raise AttributeError, name |
print 'extern void %s_init();' % (functionnameify(o[0])) | print 'extern void %s_init (void);' % (functionnameify(o[0])) | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' p... |
print 'gimp_composite_init()' | print 'gimp_composite_init (void)' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' p... |
print ' char *p;' | print ' if (g_getenv ("GIMP_COMPOSITE"))' print ' {' print ' gimp_composite_options.use = TRUE;' print ' g_printerr ("Using new image composite functions\\n");' print ' }' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' p... |
print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' print ' g_printerr("Using new image composite functions\n");' print ' }' print '' print ' if (!gimp_composite_options.initialised) {' | print ' if (! gimp_composite_options.initialised)' print ' {' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' p... |
print ' %s_init();' % (functionnameify(o[0])) pass print ' gimp_composite_options.initialised = 1;' print ' }' | print ' %s_init ();' % (functionnameify(o[0])) pass print ' gimp_composite_options.initialised = TRUE;' print ' }' | def gimp_composite_init(function_tables): for o in function_tables: print 'extern void %s_init();' % (functionnameify(o[0])) pass print '' print 'void' print 'gimp_composite_init()' print '{' print ' char *p;' print '' print ' if ((p = getenv("GIMP_COMPOSITE"))) {' print ' gimp_composite_options.use = atol(p);' p... |
"<Image>/Filters/Web/Py-Slice...", | "<Image>/Filters/Web/_Py-Slice...", | def cell(self, src, width, height): out = ('\t\t<td><img alt=" " src="%%s" width="%d" height="%d"></td>' % (width, height)) self.write(out, src) |
if orientation == ORIENTATION_VERTICAL: vguides.append((image.get_guide_position(guide), guide)) elif orientation == ORIENTATION_HORIZONTAL: hguides.append((image.get_guide_position(guide), guide)) | guide_position = image.get_guide_position(guide) if guide_position > 0: if orientation == ORIENTATION_VERTICAL: if guide_position < image.width: vguides.append((guide_position, guide)) elif orientation == ORIENTATION_HORIZONTAL: if guide_position < image.height: hguides.append((guide_position, guide)) | def get_guides(image): vguides = [] hguides = [] for guide in GuideIter(image): orientation = image.get_guide_orientation(guide) if orientation == ORIENTATION_VERTICAL: vguides.append((image.get_guide_position(guide), guide)) elif orientation == ORIENTATION_HORIZONTAL: hguides.append((image.get_guide_position(guide),... |
(PF_RADIO, "image-extension", _("Image format") + "{gif, jpg, png}", "gif", (("gif", "gif"), ("jpg", "jpg"), ("png", "png"))), (PF_TOGGLE, "separate-image-dir", _("Separate image folder"), | (PF_RADIO, "image-extension", _("Image format"), "gif", (("gif", "gif"), ("jpg", "jpg"), ("png", "png"))), (PF_TOGGLE, "separate-image-dir", _("Separate image folder"), | def parse_urls (self): """ This will parse any url targets in the href="XX" fields of the given file and return then as a list """ import re url_list = [] try: html_file = open (self.filename) #Regular expression to pick everything up to the next doublequote #character after finding the sequence 'href="'. The found ... |
(PF_STRING, "relative-image-path", _("Folder for image export"), "images/"), | (PF_STRING, "relative-image-path", _("Folder for image export"), "images"), | def parse_urls (self): """ This will parse any url targets in the href="XX" fields of the given file and return then as a list """ import re url_list = [] try: html_file = open (self.filename) #Regular expression to pick everything up to the next doublequote #character after finding the sequence 'href="'. The found ... |
(PF_TOGGLE, "animate", _("Javascript for onmouseover and clicked)"), | (PF_TOGGLE, "animate", _("Javascript for onmouseover and clicked"), | def parse_urls (self): """ This will parse any url targets in the href="XX" fields of the given file and return then as a list """ import re url_list = [] try: html_file = open (self.filename) #Regular expression to pick everything up to the next doublequote #character after finding the sequence 'href="'. The found ... |
"<Image>/Filters/Render/Clouds/Add _fog...", | "<Image>/Filters/Render/Clouds/Add _Fog...", | def python_foggify(img, layer, name, colour, turbulence, opacity): img.undo_group_start() fog = gimp.Layer(img, name, layer.width, layer.height, RGBA_IMAGE, opacity, NORMAL_MODE) img.add_layer(fog, 0) oldbg = gimp.get_background() gimp.set_background(colour) pdb.gimp_edit_fill(fog, BACKGROUND_FILL) gimp.set_backgroun... |
box = gtk.HBox(gtk.FALSE, 5) | box = gtk.VBox(gtk.FALSE, 5) | def __init__(self, default=0, items=(("Yes", 1), ("No", 0))): gtk.Frame.__init__(self) box = gtk.HBox(gtk.FALSE, 5) self.add(box) box.show() button = None for (label, value) in items: button = gtk.RadioButton(button, label) button.connect("toggled", self.changed, value) box.pack_start(button) button.show() if value == ... |
img.undo_group_start(img) | img.undo_group_start() | def shadow_bevel(img, drawable, blur, bevel, do_shadow, drop_x, drop_y): # disable undo for the image img.undo_group_start(img) # copy the layer shadow = drawable.copy(TRUE) img.add_layer(shadow, img.layers.index(drawable)+1) shadow.name = drawable.name + " shadow" shadow.preserve_trans = FALSE # threshold the shadow... |
img.undo_group_end(img) | img.undo_group_end() | def shadow_bevel(img, drawable, blur, bevel, do_shadow, drop_x, drop_y): # disable undo for the image img.undo_group_start(img) # copy the layer shadow = drawable.copy(TRUE) img.add_layer(shadow, img.layers.index(drawable)+1) shadow.name = drawable.name + " shadow" shadow.preserve_trans = FALSE # threshold the shadow... |
res = TeamSetStatRes2() | res = TeamSetStatRes2(qc.self) | def TeamCapturePlayerUpdate(*qwp_extra): e = engine.world n = None t = None s1 = None s2 = None s3 = None res = None if qc.self.laststattime > qc.time: return TeamCaptureCheckUpdate() qc.self.laststattime = qc.time + PLAYERSTATTIME if qc.self.motd_count: MOTD() return if qc.self.statstate < 0: return res = TeamSetStat... |
class Calendar: def __init__(self,this): self.this = this def __del__(self,QuantLibc=QuantLibc): if self.thisown == 1 : QuantLibc.delete_Calendar(self) def roll(*args, **kwargs): val = apply(QuantLibc.Calendar_roll,args, kwargs) if val: val = DatePtr(val) ; val.thisown = 1 return val def advance(*args, **kwargs): val ... | class Array: def __init__(self,*args,**kwargs): self.this = apply(QuantLibc.new_Array,args,kwargs) self.thisown = 1 def __del__(self,QuantLibc=QuantLibc): if self.thisown == 1 : QuantLibc.delete_Array(self) def __getslice__(*args, **kwargs): val = apply(QuantLibc.Array___getslice__,args, kwargs) if val: val = ArrayPtr... | def __init__(self,this): self.this = this self.thisown = 0 self.__class__ = DateVector |
class Array: def __init__(self,*args,**kwargs): self.this = apply(QuantLibc.new_Array,args,kwargs) self.thisown = 1 def __del__(self,QuantLibc=QuantLibc): if self.thisown == 1 : QuantLibc.delete_Array(self) def __getslice__(*args, **kwargs): val = apply(QuantLibc.Array___getslice__,args, kwargs) if val: val = ArrayPtr... | def __init__(self,this): self.this = this self.thisown = 0 self.__class__ = Instrument | |
class UniformRandomGenerator: def __init__(self,*args,**kwargs): self.this = apply(QuantLibc.new_UniformRandomGenerator,args,kwargs) self.thisown = 1 def __del__(self,QuantLibc=QuantLibc): if self.thisown == 1 : QuantLibc.delete_UniformRandomGenerator(self) def __repr__(self): return "<C UniformRandomGenerator instanc... | def __init__(self,this): self.this = this self.thisown = 0 self.__class__ = BarrierOption | |
def LexicographicalView(*args, **kwargs): val = apply(QuantLibc.LexicographicalView,args,kwargs) if val: val = ArrayLexicographicalViewPtr(val); val.thisown = 1 return val | def LexicographicalView(*args, **kwargs): val = apply(QuantLibc.LexicographicalView,args,kwargs) if val: val = ArrayLexicographicalViewPtr(val); val.thisown = 1 return val | |
Date.dayOfWeek = new.instancemethod(QuantLibc.Date_dayOfWeek, None, Date) | Date.weekday = new.instancemethod(QuantLibc.Date_weekday, None, Date) | def __init__(self,this): self.this = this self.thisown = 0 self.__class__ = Date |
TermStructure.__str__ = new.instancemethod(QuantLibc.TermStructure___str__, None, TermStructure) TermStructure.__repr__ = new.instancemethod(QuantLibc.TermStructure___repr__, None, TermStructure) | def __init__(self,this): self.this = this self.thisown = 0 self.__class__ = TermStructure |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.