Cmd.cpp (pymol-v2.1.0.tar.bz2) | : | Cmd.cpp (pymol-open-source-2.2.0) | ||
---|---|---|---|---|
skipping to change at line 67 | skipping to change at line 67 | |||
#include"ObjectMesh.h" | #include"ObjectMesh.h" | |||
#include"ObjectMap.h" | #include"ObjectMap.h" | |||
#include"ObjectCallback.h" | #include"ObjectCallback.h" | |||
#include"ObjectCGO.h" | #include"ObjectCGO.h" | |||
#include"ObjectSurface.h" | #include"ObjectSurface.h" | |||
#include"ObjectSlice.h" | #include"ObjectSlice.h" | |||
#include"Executive.h" | #include"Executive.h" | |||
#include"Selector.h" | #include"Selector.h" | |||
#include"main.h" | #include"main.h" | |||
#include"Scene.h" | #include"Scene.h" | |||
#include"SceneRay.h" | ||||
#include"Setting.h" | #include"Setting.h" | |||
#include"Movie.h" | #include"Movie.h" | |||
#include"Export.h" | #include"Export.h" | |||
#include"P.h" | #include"P.h" | |||
#include"PConv.h" | #include"PConv.h" | |||
#include"Control.h" | #include"Control.h" | |||
#include"Editor.h" | #include"Editor.h" | |||
#include"Wizard.h" | #include"Wizard.h" | |||
#include"SculptCache.h" | #include"SculptCache.h" | |||
#include"TestPyMOL.h" | #include"TestPyMOL.h" | |||
skipping to change at line 152 | skipping to change at line 153 | |||
PyMOLGlobals **G_handle = (PyMOLGlobals**)PyCObject_AsVoidPtr(self); \ | PyMOLGlobals **G_handle = (PyMOLGlobals**)PyCObject_AsVoidPtr(self); \ | |||
if(G_handle) { \ | if(G_handle) { \ | |||
return *G_handle; | return *G_handle; | |||
} \ | } \ | |||
} | } | |||
return NULL; | return NULL; | |||
} | } | |||
#define API_HANDLE_ERROR \ | #define API_HANDLE_ERROR \ | |||
if (PyErr_Occurred()) PyErr_Print(); \ | ||||
fprintf(stderr,"API-Error: in %s line %d.\n",__FILE__,__LINE__); | fprintf(stderr,"API-Error: in %s line %d.\n",__FILE__,__LINE__); | |||
/* NOTE: the glut_thread_keep_out variable can only be changed by the thread | /* NOTE: the glut_thread_keep_out variable can only be changed by the thread | |||
holding the API lock, therefore this is safe even through increment | holding the API lock, therefore this is safe even through increment | |||
isn't (necessarily) atomic. */ | isn't (necessarily) atomic. */ | |||
static void APIEnter(PyMOLGlobals * G) | static void APIEnter(PyMOLGlobals * G) | |||
{ /* assumes API is locked */ | { /* assumes API is locked */ | |||
PRINTFD(G, FB_API) | PRINTFD(G, FB_API) | |||
" APIEnter-DEBUG: as thread %ld.\n", PyThread_get_thread_ident() | " APIEnter-DEBUG: as thread %ld.\n", PyThread_get_thread_ident() | |||
skipping to change at line 1484 | skipping to change at line 1486 | |||
return APIResultOk(ok); | return APIResultOk(ok); | |||
} | } | |||
static PyObject *CmdGetColor(PyObject * self, PyObject * args) | static PyObject *CmdGetColor(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *name; | char *name; | |||
int mode; | int mode; | |||
int ok = false; | int ok = false; | |||
int a, nc, nvc; | int a, nc, nvc; | |||
float *rgb; | const float *rgb; | |||
int index; | int index; | |||
PyObject *result = NULL; | PyObject *result = NULL; | |||
PyObject *tup; | PyObject *tup; | |||
ok = PyArg_ParseTuple(args, "Osi", &self, &name, &mode); | ok = PyArg_ParseTuple(args, "Osi", &self, &name, &mode); | |||
if(ok) { | if(ok) { | |||
API_SETUP_PYMOL_GLOBALS; | API_SETUP_PYMOL_GLOBALS; | |||
ok = (G != NULL); | ok = (G != NULL); | |||
} else { | } else { | |||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
} | } | |||
skipping to change at line 1522 | skipping to change at line 1524 | |||
if(ColorGetStatus(G, a) == 1) | if(ColorGetStatus(G, a) == 1) | |||
nvc++; | nvc++; | |||
} | } | |||
result = PyList_New(nvc); | result = PyList_New(nvc); | |||
nvc = 0; | nvc = 0; | |||
for(a = 0; a < nc; a++) { | for(a = 0; a < nc; a++) { | |||
if(ColorGetStatus(G, a) == 1) { | if(ColorGetStatus(G, a) == 1) { | |||
WordType buffer; | WordType buffer; | |||
tup = PyTuple_New(2); | tup = PyTuple_New(2); | |||
{ | { | |||
char *color_name = ColorGetName(G, a); | const char *color_name = ColorGetName(G, a); | |||
if(color_name) { | if(color_name) { | |||
strcpy(buffer, color_name); | strcpy(buffer, color_name); | |||
} else { | } else { | |||
buffer[0] = 0; | buffer[0] = 0; | |||
} | } | |||
} | } | |||
PyTuple_SetItem(tup, 0, PyString_FromString(buffer)); | PyTuple_SetItem(tup, 0, PyString_FromString(buffer)); | |||
PyTuple_SetItem(tup, 1, PyInt_FromLong(a)); | PyTuple_SetItem(tup, 1, PyInt_FromLong(a)); | |||
PyList_SetItem(result, nvc++, tup); | PyList_SetItem(result, nvc++, tup); | |||
} | } | |||
skipping to change at line 1549 | skipping to change at line 1551 | |||
if(ColorGetStatus(G, a) != 0) | if(ColorGetStatus(G, a) != 0) | |||
nvc++; | nvc++; | |||
} | } | |||
result = PyList_New(nvc); | result = PyList_New(nvc); | |||
nvc = 0; | nvc = 0; | |||
for(a = 0; a < nc; a++) { | for(a = 0; a < nc; a++) { | |||
if(ColorGetStatus(G, a)) { | if(ColorGetStatus(G, a)) { | |||
WordType buffer; | WordType buffer; | |||
tup = PyTuple_New(2); | tup = PyTuple_New(2); | |||
{ | { | |||
char *color_name = ColorGetName(G, a); | const char *color_name = ColorGetName(G, a); | |||
if(color_name) { | if(color_name) { | |||
strcpy(buffer, color_name); | strcpy(buffer, color_name); | |||
} else { | } else { | |||
buffer[0] = 0; | buffer[0] = 0; | |||
} | } | |||
} | } | |||
PyTuple_SetItem(tup, 0, PyString_FromString(buffer)); | PyTuple_SetItem(tup, 0, PyString_FromString(buffer)); | |||
PyTuple_SetItem(tup, 1, PyInt_FromLong(a)); | PyTuple_SetItem(tup, 1, PyInt_FromLong(a)); | |||
PyList_SetItem(result, nvc++, tup); | PyList_SetItem(result, nvc++, tup); | |||
} | } | |||
skipping to change at line 3735 | skipping to change at line 3737 | |||
return (Py_BuildValue("f", overlap)); | return (Py_BuildValue("f", overlap)); | |||
} | } | |||
static PyObject *CmdDist(PyObject * self, PyObject * args) | static PyObject *CmdDist(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *name, *str1, *str2; | char *name, *str1, *str2; | |||
float cutoff, result = -1.0; | float cutoff, result = -1.0; | |||
int labels, quiet; | int labels, quiet; | |||
int mode, reset, state, zoom; | int mode, reset, state, zoom; | |||
int state1, state2; | ||||
int ok = false; | int ok = false; | |||
ok = PyArg_ParseTuple(args, "Osssifiiiii", &self, &name, &str1, | ok = PyArg_ParseTuple(args, "Osssifiiiiiii", &self, &name, &str1, | |||
&str2, &mode, &cutoff, &labels, &quiet, &reset, &state, | &str2, &mode, &cutoff, &labels, &quiet, &reset, &state, | |||
&zoom); | &zoom, | |||
&state1, &state2); | ||||
if(ok) { | if(ok) { | |||
API_SETUP_PYMOL_GLOBALS; | API_SETUP_PYMOL_GLOBALS; | |||
ok = (G != NULL); | ok = (G != NULL); | |||
} else { | } else { | |||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
} | } | |||
if(ok && (ok = APIEnterNotModal(G))) { | if(ok && (ok = APIEnterNotModal(G))) { | |||
ok = ExecutiveDist(G, &result, name, str1, str2, mode, cutoff, | ok = ExecutiveDist(G, &result, name, str1, str2, mode, cutoff, | |||
labels, quiet, reset, state, zoom); | labels, quiet, reset, state, zoom, state1, state2); | |||
APIExit(G); | APIExit(G); | |||
} | } | |||
if(!ok) | if(!ok) | |||
return APIFailure(); | return APIFailure(); | |||
else | else | |||
return (Py_BuildValue("f", result)); | return (Py_BuildValue("f", result)); | |||
} | } | |||
static PyObject *CmdAngle(PyObject * self, PyObject * args) | static PyObject *CmdAngle(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *name, *str1, *str2, *str3; | char *name, *str1, *str2, *str3; | |||
float result = -999.0; | float result = -999.0; | |||
int labels, quiet; | int labels, quiet; | |||
int mode; | int mode; | |||
int ok = false; | int ok = false; | |||
int reset, zoom; | int reset, zoom; | |||
int state; | int state; | |||
ok = PyArg_ParseTuple(args, "Ossssiiiiii", &self, | int state1, state2, state3; | |||
ok = PyArg_ParseTuple(args, "Ossssiiiiiiiii", &self, | ||||
&name, &str1, &str2, &str3, | &name, &str1, &str2, &str3, | |||
&mode, &labels, &reset, &zoom, &quiet, &state); | &mode, &labels, &reset, &zoom, &quiet, &state, | |||
&state1, &state2, &state3); | ||||
if(ok) { | if(ok) { | |||
API_SETUP_PYMOL_GLOBALS; | API_SETUP_PYMOL_GLOBALS; | |||
ok = (G != NULL); | ok = (G != NULL); | |||
} else { | } else { | |||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
} | } | |||
if(ok && (ok = APIEnterNotModal(G))) { | if(ok && (ok = APIEnterNotModal(G))) { | |||
ok = ExecutiveAngle(G, &result, name, str1, str2, str3, | ok = ExecutiveAngle(G, &result, name, str1, str2, str3, | |||
mode, labels, reset, zoom, quiet, state); | mode, labels, reset, zoom, quiet, state, | |||
state1, state2, state3); | ||||
APIExit(G); | APIExit(G); | |||
} | } | |||
return (Py_BuildValue("f", result)); | return (Py_BuildValue("f", result)); | |||
} | } | |||
static PyObject *CmdDihedral(PyObject * self, PyObject * args) | static PyObject *CmdDihedral(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *name, *str1, *str2, *str3, *str4; | char *name, *str1, *str2, *str3, *str4; | |||
float result = -999.0; | float result = -999.0; | |||
skipping to change at line 4844 | skipping to change at line 4851 | |||
result = PyString_FromString(vla); | result = PyString_FromString(vla); | |||
ok_except2: | ok_except2: | |||
APIExit(G); | APIExit(G); | |||
return APIAutoNone(result); | return APIAutoNone(result); | |||
ok_except1: | ok_except1: | |||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
return APIAutoNone(NULL); | return APIAutoNone(NULL); | |||
} | } | |||
static PyObject *CmdGetPDB(PyObject * self, PyObject * args) | ||||
{ | ||||
PyMOLGlobals *G = NULL; | ||||
char *str1; | ||||
char *pdb = NULL; | ||||
int state; | ||||
int quiet; | ||||
char *ref_object = NULL; | ||||
int ref_state; | ||||
int mode; | ||||
OrthoLineType s1 = ""; | ||||
PyObject *result = NULL; | ||||
int ok = false; | ||||
ok = | ||||
PyArg_ParseTuple(args, "Osiisii", &self, &str1, &state, &mode, &ref_object, | ||||
&ref_state, &quiet); | ||||
if(ok) { | ||||
API_SETUP_PYMOL_GLOBALS; | ||||
ok = (G != NULL); | ||||
} else { | ||||
API_HANDLE_ERROR; | ||||
} | ||||
if(ok) { | ||||
if(!ref_object[0]) | ||||
ref_object = NULL; | ||||
if((ok = APIEnterNotModal(G))) { | ||||
ok = (SelectorGetTmp(G, str1, s1) >= 0); | ||||
pdb = | ||||
ExecutiveSeleToPDBStr(G, s1, state, true, mode, ref_object, ref_state, N | ||||
ULL, | ||||
quiet); | ||||
SelectorFreeTmp(G, s1); | ||||
APIExit(G); | ||||
} | ||||
if(pdb) | ||||
result = Py_BuildValue("s", pdb); | ||||
FreeP(pdb); | ||||
} | ||||
return (APIAutoNone(result)); | ||||
} | ||||
static PyObject *CmdGetModel(PyObject * self, PyObject * args) | static PyObject *CmdGetModel(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *str1; | char *str1; | |||
int state; | int state; | |||
char *ref_object; | char *ref_object; | |||
int ref_state; | int ref_state; | |||
OrthoLineType s1; | OrthoLineType s1; | |||
PyObject *result = NULL; | PyObject *result = NULL; | |||
int ok = false; | int ok = false; | |||
skipping to change at line 6055 | skipping to change at line 6022 | |||
NULL, NULL, 0.0F, 0.0F, false, NULL, true, -1); | NULL, NULL, 0.0F, 0.0F, false, NULL, true, -1); | |||
} else if(width || height) { | } else if(width || height) { | |||
SceneDeferImage(G, width, height, str1, -1, dpi, quiet, format); | SceneDeferImage(G, width, height, str1, -1, dpi, quiet, format); | |||
result = 1; | result = 1; | |||
} else if(!SceneGetCopyType(G)) { | } else if(!SceneGetCopyType(G)) { | |||
ExecutiveDrawNow(G); /* TODO STATUS */ | ExecutiveDrawNow(G); /* TODO STATUS */ | |||
} | } | |||
} | } | |||
if(!result) { | if(!result) { | |||
PyMOL_PushValidContext(G->PyMOL); // PyQt hack? | ||||
if(ScenePNG(G, str1, dpi, quiet, prior, format)) | if(ScenePNG(G, str1, dpi, quiet, prior, format)) | |||
result = 1; /* signal success by returning 1 instead of 0, o r -1 for error */ | result = 1; /* signal success by returning 1 instead of 0, o r -1 for error */ | |||
PyMOL_PopValidContext(G->PyMOL); | ||||
} | } | |||
APIExit(G); | APIExit(G); | |||
} | } | |||
if(!ok) | if(!ok) | |||
result = -1; | result = -1; | |||
return APIResultCode(result); | return APIResultCode(result); | |||
} | } | |||
static PyObject *CmdMPNG(PyObject * self, PyObject * args) | static PyObject *CmdMPNG(PyObject * self, PyObject * args) | |||
{ | { | |||
skipping to change at line 6082 | skipping to change at line 6051 | |||
ok = PyArg_ParseTuple(args, "Osiiiiiiiii", &self, &str1, &int1, &int2, | ok = PyArg_ParseTuple(args, "Osiiiiiiiii", &self, &str1, &int1, &int2, | |||
&int3, &int4, &format, &mode, &quiet, | &int3, &int4, &format, &mode, &quiet, | |||
&width, &height); | &width, &height); | |||
if(ok) { | if(ok) { | |||
API_SETUP_PYMOL_GLOBALS; | API_SETUP_PYMOL_GLOBALS; | |||
ok = (G != NULL); | ok = (G != NULL); | |||
} else { | } else { | |||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
} | } | |||
if(ok && (ok = APIEnterNotModal(G))) { | if(ok && (ok = APIEnterNotModal(G))) { | |||
PyMOL_PushValidContext(G->PyMOL); // PyQt hack? | ||||
ok = MoviePNG(G, str1, SettingGetGlobal_b(G, cSetting_cache_frames), | ok = MoviePNG(G, str1, SettingGetGlobal_b(G, cSetting_cache_frames), | |||
int1, int2, int3, int4, format, mode, quiet, | int1, int2, int3, int4, format, mode, quiet, | |||
width, height); | width, height); | |||
PyMOL_PopValidContext(G->PyMOL); | ||||
/* TODO STATUS */ | /* TODO STATUS */ | |||
APIExit(G); | APIExit(G); | |||
} | } | |||
return APIResultOk(ok); | return APIResultOk(ok); | |||
} | } | |||
static PyObject *CmdMSet(PyObject * self, PyObject * args) | static PyObject *CmdMSet(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *str1; | char *str1; | |||
skipping to change at line 7143 | skipping to change at line 7114 | |||
static PyObject *CmdLoadCoords(PyObject * self, PyObject * args) | static PyObject *CmdLoadCoords(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
char *str1; | char *str1; | |||
int result = false, state = 0; | int result = false, state = 0; | |||
OrthoLineType s1; | OrthoLineType s1; | |||
PyObject *coords = NULL; | PyObject *coords = NULL; | |||
if(!PyArg_ParseTuple(args, "OsO|i", &self, &str1, &coords, &state)) { | if(!PyArg_ParseTuple(args, "OsO|i", &self, &str1, &coords, &state)) { | |||
PyErr_Print(); | ||||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
ok_raise(2); | ok_raise(2); | |||
} | } | |||
ok_assert(2, str1[0]); | ok_assert(2, str1[0]); | |||
API_SETUP_PYMOL_GLOBALS; | API_SETUP_PYMOL_GLOBALS; | |||
ok_assert(2, G && APIEnterBlockedNotModal(G)); | ok_assert(2, G && APIEnterBlockedNotModal(G)); | |||
if(SelectorGetTmp(G, str1, s1) >= 0) { | if(SelectorGetTmp(G, str1, s1) >= 0) { | |||
int sele1 = SelectorIndexByName(G, s1); | int sele1 = SelectorIndexByName(G, s1); | |||
skipping to change at line 7946 | skipping to change at line 7916 | |||
} else { | } else { | |||
API_HANDLE_ERROR; | API_HANDLE_ERROR; | |||
} | } | |||
if(ok && (ok = APIEnterNotModal(G))) { | if(ok && (ok = APIEnterNotModal(G))) { | |||
ok = ExecutiveOrder(G, str1, int1, int2); | ok = ExecutiveOrder(G, str1, int1, int2); | |||
APIExit(G); | APIExit(G); | |||
} | } | |||
return APIResultOk(ok); | return APIResultOk(ok); | |||
} | } | |||
static PyObject *CmdScrollTo(PyObject * self, PyObject * args) | ||||
{ | ||||
PyMOLGlobals *G = NULL; | ||||
char *name; | ||||
int i = 0, r = -1; | ||||
if(!PyArg_ParseTuple(args, "Os|i", &self, &name, &i)) { | ||||
API_HANDLE_ERROR; | ||||
ok_raise(1); | ||||
} | ||||
ok_assert(1, name && name[0]); | ||||
API_SETUP_PYMOL_GLOBALS; | ||||
ok_assert(2, G && APIEnterBlockedNotModal(G)); | ||||
r = ExecutiveScrollTo(G, name, i); | ||||
ok_except2: | ||||
APIExitBlocked(G); | ||||
ok_except1: | ||||
return Py_BuildValue("i", r); | ||||
} | ||||
static PyObject *CmdWindow(PyObject * self, PyObject * args) | static PyObject *CmdWindow(PyObject * self, PyObject * args) | |||
{ | { | |||
PyMOLGlobals *G = NULL; | PyMOLGlobals *G = NULL; | |||
int int1, x, y, width, height; | int int1, x, y, width, height; | |||
int ok = false; | int ok = false; | |||
ok = PyArg_ParseTuple(args, "Oiiiii", &self, &int1, &x, &y, &width, &height); | ok = PyArg_ParseTuple(args, "Oiiiii", &self, &int1, &x, &y, &width, &height); | |||
if(ok) { | if(ok) { | |||
API_SETUP_PYMOL_GLOBALS; | API_SETUP_PYMOL_GLOBALS; | |||
ok = (G != NULL); | ok = (G != NULL); | |||
} else { | } else { | |||
skipping to change at line 8418 | skipping to change at line 8412 | |||
{"get_movie_playing", CmdGetMoviePlaying, METH_VARARGS}, | {"get_movie_playing", CmdGetMoviePlaying, METH_VARARGS}, | |||
{"get_names", CmdGetNames, METH_VARARGS}, | {"get_names", CmdGetNames, METH_VARARGS}, | |||
{"get_object_color_index", CmdGetObjectColorIndex, METH_VARARGS}, | {"get_object_color_index", CmdGetObjectColorIndex, METH_VARARGS}, | |||
{"get_object_matrix", CmdGetObjectMatrix, METH_VARARGS}, | {"get_object_matrix", CmdGetObjectMatrix, METH_VARARGS}, | |||
{"get_object_ttt", CmdGetObjectTTT, METH_VARARGS}, | {"get_object_ttt", CmdGetObjectTTT, METH_VARARGS}, | |||
{"get_object_settings", CmdGetObjectSettings, METH_VARARGS}, | {"get_object_settings", CmdGetObjectSettings, METH_VARARGS}, | |||
{"get_origin", CmdGetOrigin, METH_VARARGS}, | {"get_origin", CmdGetOrigin, METH_VARARGS}, | |||
{"get_position", CmdGetPosition, METH_VARARGS}, | {"get_position", CmdGetPosition, METH_VARARGS}, | |||
{"get_povray", CmdGetPovRay, METH_VARARGS}, | {"get_povray", CmdGetPovRay, METH_VARARGS}, | |||
{"get_progress", CmdGetProgress, METH_VARARGS}, | {"get_progress", CmdGetProgress, METH_VARARGS}, | |||
{"get_pdb", CmdGetPDB, METH_VARARGS}, | ||||
{"get_phipsi", CmdGetPhiPsi, METH_VARARGS}, | {"get_phipsi", CmdGetPhiPsi, METH_VARARGS}, | |||
{"get_renderer", CmdGetRenderer, METH_VARARGS}, | {"get_renderer", CmdGetRenderer, METH_VARARGS}, | |||
{"get_raw_alignment", CmdGetRawAlignment, METH_VARARGS}, | {"get_raw_alignment", CmdGetRawAlignment, METH_VARARGS}, | |||
{"get_seq_align_str", CmdGetSeqAlignStr, METH_VARARGS}, | {"get_seq_align_str", CmdGetSeqAlignStr, METH_VARARGS}, | |||
{"get_session", CmdGetSession, METH_VARARGS}, | {"get_session", CmdGetSession, METH_VARARGS}, | |||
{"get_setting_of_type", CmdGetSettingOfType, METH_VARARGS}, | {"get_setting_of_type", CmdGetSettingOfType, METH_VARARGS}, | |||
{"get_setting_type", CmdGetSettingType, METH_VARARGS}, | {"get_setting_type", CmdGetSettingType, METH_VARARGS}, | |||
{"get_setting_tuple", CmdGetSettingTuple, METH_VARARGS}, | {"get_setting_tuple", CmdGetSettingTuple, METH_VARARGS}, | |||
{"get_setting_text", CmdGetSettingText, METH_VARARGS}, | {"get_setting_text", CmdGetSettingText, METH_VARARGS}, | |||
{"get_setting_updates", CmdGetSettingUpdates, METH_VARARGS}, | {"get_setting_updates", CmdGetSettingUpdates, METH_VARARGS}, | |||
skipping to change at line 8498 | skipping to change at line 8491 | |||
{"mplay", CmdMPlay, METH_VARARGS}, | {"mplay", CmdMPlay, METH_VARARGS}, | |||
{"mpng_", CmdMPNG, METH_VARARGS}, | {"mpng_", CmdMPNG, METH_VARARGS}, | |||
{"mmatrix", CmdMMatrix, METH_VARARGS}, | {"mmatrix", CmdMMatrix, METH_VARARGS}, | |||
{"mview", CmdMView, METH_VARARGS}, | {"mview", CmdMView, METH_VARARGS}, | |||
{"object_update_thread", CmdObjectUpdateThread, METH_VARARGS}, | {"object_update_thread", CmdObjectUpdateThread, METH_VARARGS}, | |||
{"origin", CmdOrigin, METH_VARARGS}, | {"origin", CmdOrigin, METH_VARARGS}, | |||
{"orient", CmdOrient, METH_VARARGS}, | {"orient", CmdOrient, METH_VARARGS}, | |||
{"onoff", CmdOnOff, METH_VARARGS}, | {"onoff", CmdOnOff, METH_VARARGS}, | |||
{"onoff_by_sele", CmdOnOffBySele, METH_VARARGS}, | {"onoff_by_sele", CmdOnOffBySele, METH_VARARGS}, | |||
{"order", CmdOrder, METH_VARARGS}, | {"order", CmdOrder, METH_VARARGS}, | |||
{"scrollto", CmdScrollTo, METH_VARARGS}, | ||||
{"overlap", CmdOverlap, METH_VARARGS}, | {"overlap", CmdOverlap, METH_VARARGS}, | |||
{"p_glut_event", CmdPGlutEvent, METH_VARARGS}, | {"p_glut_event", CmdPGlutEvent, METH_VARARGS}, | |||
{"p_glut_get_redisplay", CmdPGlutGetRedisplay, METH_VARARGS}, | {"p_glut_get_redisplay", CmdPGlutGetRedisplay, METH_VARARGS}, | |||
{"paste", CmdPaste, METH_VARARGS}, | {"paste", CmdPaste, METH_VARARGS}, | |||
{"png", CmdPNG, METH_VARARGS}, | {"png", CmdPNG, METH_VARARGS}, | |||
{"pop", CmdPop, METH_VARARGS}, | {"pop", CmdPop, METH_VARARGS}, | |||
{"protect", CmdProtect, METH_VARARGS}, | {"protect", CmdProtect, METH_VARARGS}, | |||
{"pseudoatom", CmdPseudoatom, METH_VARARGS}, | {"pseudoatom", CmdPseudoatom, METH_VARARGS}, | |||
{"push_undo", CmdPushUndo, METH_VARARGS}, | {"push_undo", CmdPushUndo, METH_VARARGS}, | |||
{"quit", CmdQuit, METH_VARARGS}, | {"quit", CmdQuit, METH_VARARGS}, | |||
skipping to change at line 8606 | skipping to change at line 8600 | |||
{NULL, NULL} /* sentinel */ | {NULL, NULL} /* sentinel */ | |||
}; | }; | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
void init_cmd(void) | void init_cmd(void) | |||
{ | { | |||
#if PY_MAJOR_VERSION < 3 | #if PY_MAJOR_VERSION < 3 | |||
PyUnicode_SetDefaultEncoding("utf-8"); | ||||
Py_InitModule4("pymol._cmd", | Py_InitModule4("pymol._cmd", | |||
Cmd_methods, | Cmd_methods, | |||
"PyMOL _cmd internal API -- PRIVATE: DO NOT USE!", | "PyMOL _cmd internal API -- PRIVATE: DO NOT USE!", | |||
PyCObject_FromVoidPtr((void *) &SingletonPyMOLGlobals, NULL), | PyCObject_FromVoidPtr((void *) &SingletonPyMOLGlobals, NULL), | |||
PYTHON_API_VERSION); | PYTHON_API_VERSION); | |||
#endif | #endif | |||
} | } | |||
#if PY_MAJOR_VERSION >= 3 | #if PY_MAJOR_VERSION >= 3 | |||
PyObject * PyInit__cmd(void) | PyObject * PyInit__cmd(void) | |||
End of changes. 21 change blocks. | ||||
53 lines changed or deleted | 47 lines changed or added |