diff options
author | Justin Lecher <jlec@gentoo.org> | 2013-06-18 12:20:14 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2013-06-18 12:20:14 +0000 |
commit | d34819ee43d57a275bb34598f7ea895b714ba19c (patch) | |
tree | e33917a03ca3533a860123d3b3bb0340e698c5cc /sci-chemistry/pymol | |
parent | Changed DESCRIPTION to make clear what purpose this package has (bug #372475) (diff) | |
download | gentoo-2-d34819ee43d57a275bb34598f7ea895b714ba19c.tar.gz gentoo-2-d34819ee43d57a275bb34598f7ea895b714ba19c.tar.bz2 gentoo-2-d34819ee43d57a275bb34598f7ea895b714ba19c.zip |
sci-chemistry/pymol: Add backports of upstream bugfixes
(Portage version: 2.2.0_alpha180/cvs/Linux x86_64, signed Manifest commit with key 8009D6F070EB7916)
Diffstat (limited to 'sci-chemistry/pymol')
-rw-r--r-- | sci-chemistry/pymol/ChangeLog | 8 | ||||
-rw-r--r-- | sci-chemistry/pymol/files/pymol-1.6.0.0-bg_rgb.patch | 254 | ||||
-rw-r--r-- | sci-chemistry/pymol/files/pymol-1.6.0.0-labels.patch | 372 | ||||
-rw-r--r-- | sci-chemistry/pymol/pymol-1.6.0.0-r1.ebuild | 99 |
4 files changed, 732 insertions, 1 deletions
diff --git a/sci-chemistry/pymol/ChangeLog b/sci-chemistry/pymol/ChangeLog index 2382f9cf54a2..0ce39b4be0f0 100644 --- a/sci-chemistry/pymol/ChangeLog +++ b/sci-chemistry/pymol/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sci-chemistry/pymol # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pymol/ChangeLog,v 1.101 2013/06/12 08:10:49 jlec Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pymol/ChangeLog,v 1.102 2013/06/18 12:20:13 jlec Exp $ + +*pymol-1.6.0.0-r1 (18 Jun 2013) + + 18 Jun 2013; Justin Lecher <jlec@gentoo.org> +pymol-1.6.0.0-r1.ebuild, + +files/pymol-1.6.0.0-bg_rgb.patch, +files/pymol-1.6.0.0-labels.patch: + Add backports of upstream bugfixes *pymol-1.6.0.0 (12 Jun 2013) diff --git a/sci-chemistry/pymol/files/pymol-1.6.0.0-bg_rgb.patch b/sci-chemistry/pymol/files/pymol-1.6.0.0-bg_rgb.patch new file mode 100644 index 000000000000..39fcbc019bbe --- /dev/null +++ b/sci-chemistry/pymol/files/pymol-1.6.0.0-bg_rgb.patch @@ -0,0 +1,254 @@ +Index: pymol/setup.py +=================================================================== +--- pymol/setup.py (revision 4031) ++++ pymol/setup.py (revision 4032) +@@ -123,10 +123,10 @@ + out.write('"%s" "%s"' % (python_exe, pymol_file)) + out.write(' %1 %2 %3 %4 %5 %6 %7 %8 %9' + os.linesep) + else: +- out.write('#!/bin/sh' + os.linesep) ++ out.write('#!/bin/bash' + os.linesep) + if sys.platform.startswith('darwin'): +- out.write('if [ "$DISPLAY" == "" ]; then DISPLAY=":0.0"; export DISPLAY; fi' + os.linesep) +- out.write('PYMOL_PATH="%s"; export PYMOL_PATH' % pymol_path + os.linesep) ++ out.write('[ "$DISPLAY" == "" ] && export DISPLAY=":0.0"' + os.linesep) ++ out.write('export PYMOL_PATH="%s"' % pymol_path + os.linesep) + out.write('"%s" "%s" "$@"' % (python_exe, pymol_file) + os.linesep) + + os.chmod(launch_script, 0755) +@@ -135,12 +135,16 @@ + + #============================================================================ + ++# should be something like (build_base + "/generated"), but that's only ++# known to build and install instances ++generated_dir = os.path.join(os.environ.get("PYMOL_BLD", "build"), "generated") ++ + import create_shadertext + create_shadertext.create_shadertext( + "data/shaders", + "shadertext.txt", +- "generated/include/ShaderText.h", +- "generated/src/ShaderText.c") ++ generated_dir + "/ShaderText.h", ++ generated_dir + "/ShaderText.c") + + pymol_src_dirs = [ + "ov/src", +@@ -152,12 +156,10 @@ + "layer5", + "modules/cealign/src", + "modules/cealign/src/tnt", +- 'generated/src', +- 'generated/include', ++ generated_dir, + ] + + def_macros = [ +- ("_PYMOL_MODULE", None), + ] + + libs = [] +@@ -226,27 +228,32 @@ + + for prefix in prefix_path: + inc_dirs += filter(os.path.isdir, [prefix + s for s in ["/include", "/include/freetype2"]]) +- lib_dirs += filter(os.path.isdir, [prefix + s for s in ["/lib"]]) ++ lib_dirs += filter(os.path.isdir, [prefix + s for s in ["/lib64", "/lib"]]) + + glut = posix_find_lib(['glut', 'freeglut'], lib_dirs) +- for _libs in (libs, pyogl_libs): +- _libs += ["GL", "GLU", "GLEW", glut] + +- ext_comp_args = ["-ffast-math", "-funroll-loops", "-O3", "-fcommon"] ++ libs += ["GLEW"] ++ pyogl_libs += ["GL", "GLU", glut] + ++ libs += pyogl_libs ++ ++ ext_comp_args += ["-ffast-math", "-funroll-loops", "-O3", "-fcommon"] ++ + def get_pymol_version(): + return re.findall(r'_PyMOL_VERSION "(.*)"', open('layer0/Version.h').read())[0] + + def get_sources(subdirs, suffixes=('.c', '.cpp')): + return [f for d in subdirs for s in suffixes for f in glob(d + '/*' + s)] + +-def get_packages(base, parent='', r=[]): ++def get_packages(base, parent='', r=None): + from os.path import join, exists ++ if r is None: ++ r = [] + if parent: + r.append(parent) + for name in os.listdir(join(base, parent)): + if '.' not in name and exists(join(base, parent, name, '__init__.py')): +- get_packages(base, join(parent, name)) ++ get_packages(base, join(parent, name), r) + return r + + def pyogl_extension(name, sources): +@@ -260,7 +267,10 @@ + author = "Schrodinger", + url = "http://pymol.org", + contact = "pymol-users@lists.sourceforge.net", +- description = "PyMOL is a Python-enhanced molecular graphics tool. It excels at 3D visualization of proteins, small molecules, density, surfaces, and trajectories. It also includes molecular editing, ray tracing, and movies. Open Source PyMOL is free to everyone!", ++ description = ("PyMOL is a Python-enhanced molecular graphics tool. " ++ "It excels at 3D visualization of proteins, small molecules, density, " ++ "surfaces, and trajectories. It also includes molecular editing, " ++ "ray tracing, and movies. Open Source PyMOL is free to everyone!"), + + package_dir = {'' : 'modules'}, + packages = get_packages('modules'), +Index: pymol/ChangeLog +=================================================================== +--- pymol/ChangeLog (revision 4031) ++++ pymol/ChangeLog (revision 4032) +@@ -2,6 +2,12 @@ + CHANGE LOG + ========================================================================= + ++2013-06-18 Blaine Bell, Thomas Holder ++ ++ * fixed loading in bg_rgb settings from old project pse files ++ ++ * add URL support for run command ++ + 2013-06-13 Blaine Bell <blaine.bell@schrodinger.com> + + * fixed labels when use_shaders is 0 and show_frame_rate is on +Index: pymol/layer1/Setting.c +=================================================================== +--- pymol/layer1/Setting.c (revision 4031) ++++ pymol/layer1/Setting.c (revision 4032) +@@ -41,6 +41,7 @@ + #include"ShaderMgr.h" + #include"Sphere.h" + #include"Selector.h" ++#include"Parse.h" + + static void *SettingPtr(CSetting * I, int index, ov_size size); + +@@ -920,43 +921,67 @@ + set_type = false; + break; + default: +- if(ok) +- switch (setting_type) { +- case cSetting_boolean: +- case cSetting_int: +- ok = PConvPyIntToInt(PyList_GetItem(list, 2), +- (int *) SettingPtr(I, index, sizeof(int))); +- break; +- case cSetting_color: +- { +- int color = 0; +- ok = PConvPyIntToInt(PyList_GetItem(list, 2), &color); +- if(ok) +- color = ColorConvertOldSessionIndex(I->G, color); +- *((int *) SettingPtr(I, index, sizeof(int))) = color; +- } +- break; +- case cSetting_float: +- ok = PConvPyFloatToFloat(PyList_GetItem(list, 2), +- (float *) SettingPtr(I, index, sizeof(float))); +- break; +- case cSetting_float3: +- ok = PConvPyListToFloatArrayInPlaceAutoZero(PyList_GetItem(list, 2), +- (float *) SettingPtr(I, index, +- 3 * +- sizeof +- (float)), 3); +- break; +- case cSetting_string: +- ok = PConvPyStrToStrPtr(PyList_GetItem(list, 2), &str); +- if(ok) { +- strcpy(((char *) SettingPtr(I, index, strlen(str) + 1)), str); +- } +- break; +- } ++ if(ok){ ++ int skip = false; ++ switch (index){ ++ case cSetting_bg_rgb: ++ case cSetting_bg_rgb_top: ++ case cSetting_bg_rgb_bottom: ++ if (setting_type == cSetting_float3){ ++ float vals[3]; ++ ok = PConvPyListToFloatArrayInPlaceAutoZero(PyList_GetItem(list, 2), (float*)&vals, 3); ++ if (ok){ ++ SettingSet_color_from_3f(I, index, vals); ++ setting_type = cSetting_color; ++ skip = true; ++ } ++ } else if (setting_type == cSetting_color){ ++ int color = 0; ++ ok = PConvPyIntToInt(PyList_GetItem(list, 2), &color); ++ if(ok) ++ color = ColorConvertOldSessionIndex(I->G, color); ++ *((int *) SettingPtr(I, index, sizeof(int))) = color; ++ } ++ } ++ if (!skip){ ++ switch (setting_type) { ++ case cSetting_boolean: ++ case cSetting_int: ++ ok = PConvPyIntToInt(PyList_GetItem(list, 2), ++ (int *) SettingPtr(I, index, sizeof(int))); ++ break; ++ case cSetting_color: ++ { ++ int color = 0; ++ ok = PConvPyIntToInt(PyList_GetItem(list, 2), &color); ++ if(ok) ++ color = ColorConvertOldSessionIndex(I->G, color); ++ *((int *) SettingPtr(I, index, sizeof(int))) = color; ++ } ++ break; ++ case cSetting_float: ++ ok = PConvPyFloatToFloat(PyList_GetItem(list, 2), ++ (float *) SettingPtr(I, index, sizeof(float))); ++ break; ++ case cSetting_float3: ++ ok = PConvPyListToFloatArrayInPlaceAutoZero(PyList_GetItem(list, 2), ++ (float *) SettingPtr(I, index, ++ 3 * ++ sizeof ++ (float)), 3); ++ break; ++ case cSetting_string: ++ ok = PConvPyStrToStrPtr(PyList_GetItem(list, 2), &str); ++ if(ok) { ++ strcpy(((char *) SettingPtr(I, index, strlen(str) + 1)), str); ++ } ++ break; ++ } ++ } ++ } + } + if(ok && set_type) +- I->info[index].type = setting_type; ++ I->info[index].type = setting_type; + } + } + return (ok); +Index: pymol/modules/pymol/parsing.py +=================================================================== +--- pymol/modules/pymol/parsing.py (revision 4031) ++++ pymol/modules/pymol/parsing.py (revision 4032) +@@ -437,6 +437,15 @@ + + # launching routines + ++ def execfile(filename, global_ns, local_ns): ++ if '://' in filename: ++ import pymol.internal as pi ++ co = compile(pi.file_read(filename), filename, 'exec') ++ exec(co, global_ns, local_ns) ++ else: ++ import __builtin__ as b ++ b.execfile(filename, global_ns, local_ns) ++ + def run_file(file,global_ns,local_ns): + pymol.__script__ = file + try: diff --git a/sci-chemistry/pymol/files/pymol-1.6.0.0-labels.patch b/sci-chemistry/pymol/files/pymol-1.6.0.0-labels.patch new file mode 100644 index 000000000000..170ab2edcd95 --- /dev/null +++ b/sci-chemistry/pymol/files/pymol-1.6.0.0-labels.patch @@ -0,0 +1,372 @@ +Index: pymol/ChangeLog +=================================================================== +--- pymol/ChangeLog (revision 4030) ++++ pymol/ChangeLog (revision 4031) +@@ -2,6 +2,16 @@ + CHANGE LOG + ========================================================================= + ++2013-06-13 Blaine Bell <blaine.bell@schrodinger.com> ++ ++ * fixed labels when use_shaders is 0 and show_frame_rate is on ++ ++2013-06-12 Thomas Holder <thomas.holder@schrodinger.com> ++ ++ * update APBS Tools plugin ++ ++ * fix spectrumany when minimum/maximum are provided ++ + 2013-06-11 Blaine Bell <blaine.bell@schrodinger.com> + + * Open Source PyMOL v1.6.0.0 +Index: pymol/layer1/Character.c +=================================================================== +--- pymol/layer1/Character.c (revision 4030) ++++ pymol/layer1/Character.c (revision 4031) +@@ -276,16 +276,16 @@ + rec->extent[2], rec->extent[1], + rec->extent[2], rec->extent[3] + }; +- glEnableClientState(GL_VERTEX_ARRAY); +- glEnableClientState(GL_TEXTURE_COORD_ARRAY); +-#ifdef OPENGL_ES_1 +- glClientActiveTexture(GL_TEXTURE1); +-#endif +- glVertexPointer(3, GL_FLOAT, 0, vertexVals); +- glTexCoordPointer(2, GL_FLOAT, 0, texVals); +- glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); +- glDisableClientState(GL_VERTEX_ARRAY); +- glDisableClientState(GL_TEXTURE_COORD_ARRAY); ++ glBegin(GL_QUADS); ++ glTexCoord2f(rec->extent[0], rec->extent[1]); ++ glVertex3f(v0[0], v0[1], v0[2]); ++ glTexCoord2f(rec->extent[0], rec->extent[3]); ++ glVertex3f(v0[0], v1[1], v0[2]); ++ glTexCoord2f(rec->extent[2], rec->extent[3]); ++ glVertex3f(v1[0], v1[1], v0[2]); ++ glTexCoord2f(rec->extent[2], rec->extent[1]); ++ glVertex3f(v1[0], v0[1], v0[2]); ++ glEnd(); + } + } + } +Index: pymol/modules/pymol/__init__.py +=================================================================== +--- pymol/modules/pymol/__init__.py (revision 4030) ++++ pymol/modules/pymol/__init__.py (revision 4031) +@@ -252,9 +252,11 @@ + # auto-detect bundled FREEMOL (if present) + + if not os.environ.has_key("FREEMOL"): +- test_path = os.path.join(os.environ['PYMOL_PATH'],"freemol") +- if os.path.isdir(test_path): +- os.environ['FREEMOL'] = test_path ++ for test_path in ['freemol', 'ext']: ++ test_path = os.path.join(os.environ['PYMOL_PATH'], test_path) ++ if os.path.isdir(test_path): ++ os.environ['FREEMOL'] = test_path ++ break + + # include FREEMOL's libpy in sys.path (if present) + +@@ -339,9 +341,6 @@ + elif vendor.startswith('Parallels'): + if renderer[0:8]=='Parallel': + pass +- # this was critical for older Parallels +- # but actually slows down current versions +- # cmd.set('texture_fonts',1) + + elif vendor.startswith('ATI'): + if renderer[0:17]=='FireGL2 / FireGL3': # obsolete ? +Index: pymol/modules/pymol/preset.py +=================================================================== +--- pymol/modules/pymol/preset.py (revision 4030) ++++ pymol/modules/pymol/preset.py (revision 4031) +@@ -21,7 +21,7 @@ + + tmp_sele = "_p_tmp" + +-prot_and_dna_sele = "(resn ALA+CYS+CYX+ASP+GLU+PHE+GLY+HIS+HID+HIE+HIP+HISE+HISD+HISP+ILE+LYS+LEU+MET+MSE+ASN+PRO+GLN+ARG+SER+THR+VAL+TRP+TYR+A+C+T+G+U)" ++prot_and_dna_sele = "(resn ALA+CYS+CYX+ASP+GLU+PHE+GLY+HIS+HID+HIE+HIP+HISE+HISD+HISP+ILE+LYS+LEU+MET+MSE+ASN+PRO+GLN+ARG+SER+THR+VAL+TRP+TYR+A+C+T+G+U+DA+DC+DT+DG+DU+DI)" + wat_sele = "(resn WAT,H2O,HOH,TIP)" + ion_sele = "(resn CA,HG,K,NA,ZN,MG,CL)" + solv_sele = "("+wat_sele+"|"+ion_sele+")" +Index: pymol/modules/pymol/cmd.py +=================================================================== +--- pymol/modules/pymol/cmd.py (revision 4030) ++++ pymol/modules/pymol/cmd.py (revision 4031) +@@ -310,8 +310,7 @@ + selection_sc = lambda sc=Shortcut,gn=get_names:sc(gn('public')+['all']) + object_sc = lambda sc=Shortcut,gn=get_names:sc(gn('objects')) + map_sc = lambda sc=Shortcut,gnot=get_names_of_type:sc(gnot('object:map')) +- contour_sc = lambda sc=Shortcut,gnot=get_names_of_type:sc( +- gnot('object:mesh')+gnot('object:surface')) ++ contour_sc = lambda sc=Shortcut,gnot=get_names_of_type:sc(gnot('object:mesh')+gnot('object:surface')) + group_sc = lambda sc=Shortcut,gnot=get_names_of_type:sc(gnot('object:group')) + + # Table for argument autocompletion +Index: pymol/modules/pymol/viewing.py +=================================================================== +--- pymol/modules/pymol/viewing.py (revision 4030) ++++ pymol/modules/pymol/viewing.py (revision 4031) +@@ -1393,9 +1393,9 @@ + if action=='clear': + for key in pymol._scene_dict.keys(): + # free selections +- list = pymol._scene_dict[key] +- if len(list)>3: +- colorection = list[3] ++ scene_list = pymol._scene_dict[key] ++ if len(scene_list)>3: ++ colorection = scene_list[3] + if colorection!=None: + _self.del_colorection(colorection,key) + name = "_scene_"+key+"_*" +@@ -1427,6 +1427,8 @@ + print "Error: scene '%s' not found."%key + elif new_key==None: + print "Error: must provide the 'new_key' argument" ++ elif new_key == key: ++ print "scene: '%s' not changed" % key + else: + new_scene_order = [] + for a in pymol._scene_order: +@@ -1443,9 +1445,9 @@ + if name in valid_names: + new_name = "_scene_"+new_key+"_"+rep_name + _self.set_name(name,new_name) +- list = pymol._scene_dict[new_key] +- if len(list)>3: +- _self.set_colorection_name(list[3],key,new_key) ++ scene_list = pymol._scene_dict[new_key] ++ if len(scene_list)>3: ++ _self.set_colorection_name(scene_list[3],key,new_key) + print" scene: '%s' renamed to '%s'."%(key,new_key) + pymol._scene_dict_sc.rebuild( pymol._scene_dict.keys()) + _self.set("session_changed",1,quiet=1) +@@ -1464,29 +1466,29 @@ + _self.set("scenes_changed",1,quiet=1); + key = pymol._scene_dict_sc.auto_err(key,'scene') + _self.set('scene_current_name', key, quiet=1) +- list = pymol._scene_dict[key] +- ll = len(list) ++ scene_list = pymol._scene_dict[key] ++ ll = len(scene_list) + if (ll>1) and (active): +- if list[1]!=None: ++ if scene_list[1]!=None: + _self.disable() + _self.deselect() +- _self.set_vis(list[1]) ++ _self.set_vis(scene_list[1]) + if (ll>2) and (frame): +- if list[2]!=None: ++ if scene_list[2]!=None: + if not _self.get_movie_playing(): # don't set frame when movie is already playing +- if _self.get_frame()!=list[2]: # only set the frame when it isn't already correct +- _self.frame(list[2],scene=1) # let frame know that it is being set by a scene ++ if _self.get_frame()!=scene_list[2]: # only set the frame when it isn't already correct ++ _self.frame(scene_list[2],scene=1) # let frame know that it is being set by a scene + else: + _self.set_frame(1,10) # seek scene + if (ll>3) and (color): +- if list[3]!=None: +- _self.set_colorection(list[3],key) ++ if scene_list[3]!=None: ++ _self.set_colorection(scene_list[3],key) + if (ll>4) and (rep): +- if list[4]==None: ++ if scene_list[4]==None: + rep = 0 + if (ll>5) and (message==None): +- if list[5]!=None: +- message=list[5] ++ if scene_list[5]!=None: ++ message=scene_list[5] + if rep!=0: + _self.hide("(all)") + valid_names = _self.get_names("all") +@@ -1521,8 +1523,8 @@ + if replace_flag and not mess_flag: + _self.wizard() + if (ll>0) and (view): +- if list[0]!=None: +- _self.set_view(list[0],animate,quiet,hand) ++ if scene_list[0]!=None: ++ _self.set_view(scene_list[0],animate,quiet,hand) + if not quiet and _feedback(fb_module.scene,fb_mask.actions,_self): # redundant + print " scene: \"%s\" recalled."%key + elif (action=='store') or (action=='update'): +@@ -1535,11 +1537,11 @@ + if not pymol._scene_dict.has_key(key): + pymol._scene_dict_sc.append(key) + else: # get rid of existing one (if exists) +- list = pymol._scene_dict[key] +- if (action=='update') and (message==None) and len(list)>5: ++ scene_list = pymol._scene_dict[key] ++ if (action=='update') and (message==None) and len(scene_list)>5: + message = pymol._scene_dict[key][5] +- if len(list)>3: +- colorection = list[3] ++ if len(scene_list)>3: ++ colorection = scene_list[3] + if colorection!=None: + _self.del_colorection(colorection,key) # important -- free RAM + name = "_scene_"+key+"_*" +@@ -1575,9 +1577,9 @@ + key = setting.get("scene_current_name",_self=_self) + key = pymol._scene_dict_sc.auto_err(key,'scene') + if pymol._scene_dict.has_key(key): +- list = pymol._scene_dict[key] +- if len(list)>3: +- colorection = list[3] ++ scene_list = pymol._scene_dict[key] ++ if len(scene_list)>3: ++ colorection = scene_list[3] + if colorection!=None: + _self.del_colorection(colorection,key) # important -- free RAM + lst = _scene_validate_list(_self) +@@ -2573,7 +2575,7 @@ + v = e_it.next() + if v is None: + return False +- v = (float(v) - minimum) / val_range * (n_colors - 1) ++ v = min(1.0, max(0.0, (float(v) - minimum) / val_range)) * (n_colors - 1) + i = min(int(v), n_colors - 2) + p = v - i + rgb = [int(255 * (col_tuples[i+1][j] * p + col_tuples[i][j] * (1.0 - p))) +Index: pymol/modules/pymol/checking.py +=================================================================== +--- pymol/modules/pymol/checking.py (revision 4030) ++++ pymol/modules/pymol/checking.py (revision 4031) +@@ -1,6 +1,9 @@ + + import types +-import cmd ++try: ++ import cmd ++except: ++ cmd = None + + def _raising(code=-1,_self=cmd): + # WARNING: internal routine, subject to change +Index: pymol/modules/pymol/shortcut.py +=================================================================== +--- pymol/modules/pymol/shortcut.py (revision 4030) ++++ pymol/modules/pymol/shortcut.py (revision 4031) +@@ -15,7 +15,10 @@ + if __name__=='pymol.shortcut' or __name__=='shortcut': + + import copy +- from pymol.checking import is_string, is_list ++ try: ++ from pymol.checking import is_string, is_list ++ except: ++ from checking import is_string, is_list + + def mkabbr(a, m=1): + b = a.split('_') +Index: pymol/modules/pymol/editing.py +=================================================================== +--- pymol/modules/pymol/editing.py (revision 4030) ++++ pymol/modules/pymol/editing.py (revision 4031) +@@ -400,13 +400,15 @@ + if _self._raising(r,_self): raise pymol.CmdException + return r + +- def push_undo(selection, state=0, _self=cmd): ++ def push_undo(selection, just_coordinates=1, finish_undo=0, add_objects=0, delete_objects=0, state=0, _self=cmd): + ''' + DESCRIPTION + + "push_undo" stores the current conformations of objects in the + selection onto their individual undo rings. + ++ Notice: This command is only partly implemented in open-source PyMOL. ++ + USAGE + + push_undo (all) +Index: pymol/modules/pmg_tk/skins/normal/__init__.py +=================================================================== +--- pymol/modules/pmg_tk/skins/normal/__init__.py (revision 4030) ++++ pymol/modules/pmg_tk/skins/normal/__init__.py (revision 4031) +@@ -106,19 +106,6 @@ + self.app.destroycomponent('commandframe') + + def createMessageBar(self): +- # Create the message bar area for help and status messages. +-# frame = self.app.createcomponent('bottomtray', (), None, +-# Frame,(self.app._hull,), relief=SUNKEN) +-# self.__messageBar = self.app.createcomponent('messagebar', +-# (), None, +-# Pmw.MessageBar, +-# (frame,), +-# #entry_width = 40, +-# entry_relief=SUNKEN, +-# entry_bd=1, +-# labelpos=None) +-# self.__messageBar.pack(side=LEFT, expand=NO, fill=X) +- + self.messageBar = Pmw.MessageBar(self.commandFrame, entry_width = 25, + entry_relief='sunken', entry_borderwidth=1) #, labelpos = 'w') + +@@ -139,7 +126,6 @@ + self.balloon.configure(statuscommand = self.messageBar.helpmessage) + + def destroyMessageBar(self): +- + self.messageBar.destroy() + + def get_current_session_file(self): +@@ -465,27 +451,6 @@ + self.entry.bind('<Home>',lambda e,s=self: s.cmd.do("cmd._special(106,0,0)")) + self.entry.bind('<End>',lambda e,s=self: s.cmd.do("cmd._special(107,0,0)")) + +-# obviated by changes made to the X11 OpenGL Window +-# if sys.platform=='darwin': +-# if self.app.pymol.invocation.options.external_gui==3: # PyMOLX11Hybrid focus kludge +-# self.root.bind_all('<Leave>',lambda e,s=self: s.focus_out(e)) +-# self.root.bind_all('<Enter>',lambda e,s=self: s.focus_in(e)) +- +-# def focus_in(self,event): # PyMOLX11Hybrid focus kludge +-# if self.refocus_entry: +-# self.cmd.do("_ cmd.window('defocus')") # deactivate MacPyMOL OpenGL window +-# self.refocus_entry = 0 +-# self.entry.focus_set() +- +-# def focus_out(self,event): # PyMOLX11Hybrid focus kludge +-# # necessary so that the OpenGL portion of +-# # PyMOLX11Hybrid can exhibit click-through behavior +-# if id(event.widget) == id(self.root): +-# if ((event.y>event.widget.winfo_height())): +-# self.root.focus_set() # (return cursor to entry window) +-# self.cmd.do("_ cmd.window('focus')") # activate MacPyMOL OpenGL window +-# self.refocus_entry = 1 +- + def update_feedback(self): + if self.focus_entry: + self.focus_entry=0 +@@ -981,18 +946,16 @@ + self.cmd.save(sfile,quiet=0) + + def file_save_mpeg(self): +- ok = 1 + try: + from freemol import mpeg_encode + if not mpeg_encode.validate(): +- ok = 0 + print "produce-error: Unable to validate freemol.mpeg_encode" ++ raise + except: +- ok = 0 +- pass +- if not ok: + tkMessageBox.showerror("Error", + "MPEG encoder missing.\nThe FreeMOL add-ons may not be installed.") ++ return ++ + else: + sfile = asksaveasfilename(defaultextension = _def_ext(".mpg"), + initialdir = self.initialdir, diff --git a/sci-chemistry/pymol/pymol-1.6.0.0-r1.ebuild b/sci-chemistry/pymol/pymol-1.6.0.0-r1.ebuild new file mode 100644 index 000000000000..cfbb77cbbb4f --- /dev/null +++ b/sci-chemistry/pymol/pymol-1.6.0.0-r1.ebuild @@ -0,0 +1,99 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/pymol/pymol-1.6.0.0-r1.ebuild,v 1.1 2013/06/18 12:20:13 jlec Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 ) +PYTHON_REQ_USE="tk" + +inherit distutils-r1 fdo-mime versionator + +DESCRIPTION="A Python-extensible molecular graphics system" +HOMEPAGE="http://pymol.sourceforge.net/" +SRC_URI=" + mirror://sourceforge/project/${PN}/${PN}/$(get_version_component_range 1-2)/${PN}-v${PV}.tar.bz2 + http://dev.gentoo.org/~jlec/distfiles/${PN}-icons.tar.xz" + +LICENSE="PSF-2.2" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~x64-macos ~x86-macos" +IUSE="apbs web" + +DEPEND=" + dev-python/pmw[${PYTHON_USEDEP}] + media-libs/freetype:2 + media-libs/glew + media-libs/libpng + media-video/mpeg-tools + sys-libs/zlib + media-libs/freeglut + apbs? ( + dev-libs/maloc + sci-chemistry/apbs + sci-chemistry/pdb2pqr + sci-chemistry/pymol-apbs-plugin + ) + web? ( !dev-python/webpy )" +RDEPEND="${DEPEND}" + +S="${WORKDIR}"/${PN} + +PATCHES=( + "${FILESDIR}"/${P}-labels.patch + "${FILESDIR}"/${P}-bg_rgb.patch + ) + +python_prepare_all() { + distutils-r1_python_prepare_all + sed \ + -e "s:\"/usr:\"${EPREFIX}/usr:g" \ + -e "/ext_comp_args/s:=\[.*\]$:= \[\]:g" \ + -i setup.py || die + + rm ./modules/pmg_tk/startup/apbs_tools.py || die + + sed \ + -e "s:/opt/local:${EPREFIX}/usr:g" \ + -e '/ext_comp_args/s:\[.*\]:[]:g' \ + -i setup.py || die +} + +python_install() { + distutils-r1_python_install --pymol-path="${EPREFIX}/usr/share/pymol" +} + +python_install_all() { + distutils-r1_python_install_all + + python_export python2_7 EPYTHON + + # These environment variables should not go in the wrapper script, or else + # it will be impossible to use the PyMOL libraries from Python. + cat >> "${T}"/20pymol <<- EOF + PYMOL_PATH="$(python_get_sitedir)/${PN}" + PYMOL_DATA="${EPREFIX}/usr/share/pymol/data" + PYMOL_SCRIPTS="${EPREFIX}/usr/share/pymol/scripts" + EOF + + doenvd "${T}"/20pymol + + doicon "${WORKDIR}"/${PN}.{xpm,png} + make_desktop_entry pymol PyMol ${PN} "Graphics;Education;Science;Chemistry" "MimeType=chemical/x-pdb;" + + if ! use web; then + rm -rf "${D}/$(python_get_sitedir)/web" || die + fi + + rm -f "${ED}"/usr/share/${PN}/LICENSE || die +} + +pkg_postinst() { + fdo-mime_desktop_database_update + fdo-mime_mime_database_update +} + +pkg_postrm() { + fdo-mime_desktop_database_update + fdo-mime_mime_database_update +} |