• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PyDoc_STR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PyDoc_STR函数的典型用法代码示例。如果您正苦于以下问题:C++ PyDoc_STR函数的具体用法?C++ PyDoc_STR怎么用?C++ PyDoc_STR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PyDoc_STR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: OSAMakeContext

                          AEDesc_Convert, &contextName,
                          &parentContext))
        return NULL;
    _err = OSAMakeContext(_self->ob_itself,
                          &contextName,
                          parentContext,
                          &resultingContextID);
    if (_err != noErr) return PyMac_Error(_err);
    _res = Py_BuildValue("l",
                         resultingContextID);
    return _res;
}

static PyMethodDef OSAObj_methods[] = {
    {"OSALoad", (PyCFunction)OSAObj_OSALoad, 1,
     PyDoc_STR("(AEDesc scriptData, long modeFlags) -> (OSAID resultingScriptID)")},
    {"OSAStore", (PyCFunction)OSAObj_OSAStore, 1,
     PyDoc_STR("(OSAID scriptID, DescType desiredType, long modeFlags) -> (AEDesc resultingScriptData)")},
    {"OSAExecute", (PyCFunction)OSAObj_OSAExecute, 1,
     PyDoc_STR("(OSAID compiledScriptID, OSAID contextID, long modeFlags) -> (OSAID resultingScriptValueID)")},
    {"OSADisplay", (PyCFunction)OSAObj_OSADisplay, 1,
     PyDoc_STR("(OSAID scriptValueID, DescType desiredType, long modeFlags) -> (AEDesc resultingText)")},
    {"OSAScriptError", (PyCFunction)OSAObj_OSAScriptError, 1,
     PyDoc_STR("(OSType selector, DescType desiredType) -> (AEDesc resultingErrorDescription)")},
    {"OSADispose", (PyCFunction)OSAObj_OSADispose, 1,
     PyDoc_STR("(OSAID scriptID) -> None")},
    {"OSASetScriptInfo", (PyCFunction)OSAObj_OSASetScriptInfo, 1,
     PyDoc_STR("(OSAID scriptID, OSType selector, long value) -> None")},
    {"OSAGetScriptInfo", (PyCFunction)OSAObj_OSAGetScriptInfo, 1,
     PyDoc_STR("(OSAID scriptID, OSType selector) -> (long result)")},
    {"OSAScriptingComponentName", (PyCFunction)OSAObj_OSAScriptingComponentName, 1,
开发者ID:RDWang,项目名称:python,代码行数:31,代码来源:_OSAmodule.c


示例2: IdentifyFolder

	if (!PyArg_ParseTuple(_args, "hl",
	                      &vRefNum,
	                      &dirID))
		return NULL;
	_err = IdentifyFolder(vRefNum,
	                      dirID,
	                      &foldType);
	if (_err != noErr) return PyMac_Error(_err);
	_res = Py_BuildValue("O&",
	                     PyMac_BuildOSType, foldType);
	return _res;
}

static PyMethodDef Folder_methods[] = {
	{"FindFolder", (PyCFunction)Folder_FindFolder, 1,
	 PyDoc_STR("(short vRefNum, OSType folderType, Boolean createFolder) -> (short foundVRefNum, long foundDirID)")},
	{"ReleaseFolder", (PyCFunction)Folder_ReleaseFolder, 1,
	 PyDoc_STR("(short vRefNum, OSType folderType) -> None")},
	{"FSFindFolder", (PyCFunction)Folder_FSFindFolder, 1,
	 PyDoc_STR("(short vRefNum, OSType folderType, Boolean createFolder) -> (FSRef foundRef)")},
	{"AddFolderDescriptor", (PyCFunction)Folder_AddFolderDescriptor, 1,
	 PyDoc_STR("(FolderType foldType, FolderDescFlags flags, FolderClass foldClass, FolderLocation foldLocation, OSType badgeSignature, OSType badgeType, Str255 name, Boolean replaceFlag) -> None")},
	{"GetFolderTypes", (PyCFunction)Folder_GetFolderTypes, 1,
	 PyDoc_STR("(UInt32 requestedTypeCount) -> (UInt32 totalTypeCount, FolderType theTypes)")},
	{"RemoveFolderDescriptor", (PyCFunction)Folder_RemoveFolderDescriptor, 1,
	 PyDoc_STR("(FolderType foldType) -> None")},
#ifndef __LP64__
	{"GetFolderName", (PyCFunction)Folder_GetFolderName, 1,
	 PyDoc_STR("(short vRefNum, OSType foldType, Str255 name) -> (short foundVRefNum)")},
	{"AddFolderRouting", (PyCFunction)Folder_AddFolderRouting, 1,
	 PyDoc_STR("(OSType fileType, FolderType routeFromFolder, FolderType routeToFolder, RoutingFlags flags, Boolean replaceFlag) -> None")},
开发者ID:1310701102,项目名称:sl4a,代码行数:31,代码来源:_Foldermodule.c


示例3: WaitNextEvent

                          OptResObj_Convert, &mouseregion))
        return NULL;
    _rv = WaitNextEvent(eventMask,
                        &theEvent,
                        sleep,
                        (RgnHandle)mouseregion);
    _res = Py_BuildValue("bO&",
                         _rv,
                         PyMac_BuildEventRecord, &theEvent);
    return _res;

}

static PyMethodDef Evt_methods[] = {
    {"GetMouse", (PyCFunction)Evt_GetMouse, 1,
     PyDoc_STR("() -> (Point mouseLoc)")},
    {"Button", (PyCFunction)Evt_Button, 1,
     PyDoc_STR("() -> (Boolean _rv)")},
    {"StillDown", (PyCFunction)Evt_StillDown, 1,
     PyDoc_STR("() -> (Boolean _rv)")},
    {"WaitMouseUp", (PyCFunction)Evt_WaitMouseUp, 1,
     PyDoc_STR("() -> (Boolean _rv)")},
    {"GetCaretTime", (PyCFunction)Evt_GetCaretTime, 1,
     PyDoc_STR("() -> (UInt32 _rv)")},
    {"GetKeys", (PyCFunction)Evt_GetKeys, 1,
     PyDoc_STR("() -> (KeyMap theKeys)")},
    {"GetDblTime", (PyCFunction)Evt_GetDblTime, 1,
     PyDoc_STR("() -> (UInt32 _rv)")},
    {"SetEventMask", (PyCFunction)Evt_SetEventMask, 1,
     PyDoc_STR("(EventMask value) -> None")},
    {"GetNextEvent", (PyCFunction)Evt_GetNextEvent, 1,
开发者ID:0xcc,项目名称:python-read,代码行数:31,代码来源:_Evtmodule.c


示例4: PyDoc_STR

 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 *  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser Public License
 *  along with the ZBar Bar Code Reader; if not, write to the Free
 *  Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 *  Boston, MA  02110-1301  USA
 *
 *  http://sourceforge.net/projects/zbar
 *------------------------------------------------------------------------*/

#include "zbarmodule.h"

static char symbolset_doc[] = PyDoc_STR(
    "symbol result container.\n"
    "\n"
    "collection of symbols.");

static int
symbolset_clear (zbarSymbolSet *self)
{
    if(self->zsyms) {
        zbar_symbol_set_t *zsyms = (zbar_symbol_set_t*)self->zsyms;
        self->zsyms = NULL;
        zbar_symbol_set_ref(zsyms, -1);
    }
    return(0);
}

static void
symbolset_dealloc (zbarSymbolSet *self)
开发者ID:13122310958,项目名称:ZBar,代码行数:32,代码来源:symbolset.c


示例5: Py_INCREF

    Py_INCREF(Py_None);
    return Py_None;
}

void converters_init(PyObject* dict)
{
    converters = PyDict_New();
    if (!converters) {
        return;
    }

    PyDict_SetItemString(dict, "converters", converters);
}

static PyMethodDef module_methods[] = {
    {"connect",  (PyCFunction)module_connect,  METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Creates a connection.")},
    {"complete_statement",  (PyCFunction)module_complete,  METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Checks if a string contains a complete SQL statement. Non-standard.")},
#ifdef HAVE_SHARED_CACHE
    {"enable_shared_cache",  (PyCFunction)module_enable_shared_cache,  METH_VARARGS|METH_KEYWORDS, PyDoc_STR("Enable or disable shared cache mode for the calling thread. Experimental/Non-standard.")},
#endif
    {"register_adapter", (PyCFunction)module_register_adapter, METH_VARARGS, PyDoc_STR("Registers an adapter with pysqlite's adapter registry. Non-standard.")},
    {"register_converter", (PyCFunction)module_register_converter, METH_VARARGS, PyDoc_STR("Registers a converter with pysqlite. Non-standard.")},
    {"adapt",  (PyCFunction)psyco_microprotocols_adapt, METH_VARARGS, psyco_microprotocols_adapt_doc},
    {"enable_callback_tracebacks",  (PyCFunction)enable_callback_tracebacks, METH_VARARGS, PyDoc_STR("Enable or disable callback functions throwing errors to stderr.")},
    {NULL, NULL}
};

struct _IntConstantPair {
    char* constant_name;
    int constant_value;
};
开发者ID:TathagataChakraborti,项目名称:resource-conflicts,代码行数:31,代码来源:module.c


示例6: __Pyx_Generator_set_qualname

static int
__Pyx_Generator_set_qualname(__pyx_GeneratorObject *self, PyObject *value)
{
    PyObject *tmp;

#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}

static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Generator_get_name, (setter)__Pyx_Generator_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Generator_get_qualname, (setter)__Pyx_Generator_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};

static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_GeneratorObject, is_running), READONLY, NULL},
    {0, 0, 0, 0, 0}
};

static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {"throw", (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {"close", (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};

static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",                        /*tp_name*/
    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#endif
    0,                                  /*tp_repr*/
    0,                                  /*tp_as_number*/
    0,                                  /*tp_as_sequence*/
    0,                                  /*tp_as_mapping*/
    0,                                  /*tp_hash*/
    0,                                  /*tp_call*/
    0,                                  /*tp_str*/
    0,                                  /*tp_getattro*/
    0,                                  /*tp_setattro*/
    0,                                  /*tp_as_buffer*/
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
    0,                                  /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_GeneratorObject, gi_weakreflist), /*tp_weaklistoffset*/
    0,                                  /*tp_iter*/
    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
    __pyx_Generator_methods,            /*tp_methods*/
    __pyx_Generator_memberlist,         /*tp_members*/
    __pyx_Generator_getsets,            /*tp_getset*/
    0,                                  /*tp_base*/
    0,                                  /*tp_dict*/
    0,                                  /*tp_descr_get*/
    0,                                  /*tp_descr_set*/
    0,                                  /*tp_dictoffset*/
    0,                                  /*tp_init*/
    0,                                  /*tp_alloc*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
#if PY_VERSION_HEX >= 0x030400a1
    0,                                  /*tp_del*/
#else
    __Pyx_Generator_del,                /*tp_del*/
#endif
    0,                                  /*tp_version_tag*/
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Generator_del,                /*tp_finalize*/
#endif
//.........这里部分代码省略.........
开发者ID:Aeternam,项目名称:server_status,代码行数:101,代码来源:Generator.c


示例7: scm_with_guile

		    args, kwds, "O!:eval_string", kwlist,
		    &PyString_Type, &string_arg))
		return NULL;

	PyObject *result = scm_with_guile(
		(void *(*)(void *))eval_string_wrapper, string_arg);
	if (result == NULL && !PyErr_Occurred())
		PyErr_SetNone(guile_error);
	return result;
}

static PyMethodDef methods[] = {
	{ "lookup",
	  (PyCFunction)lookup, METH_KEYWORDS,
	  PyDoc_STR("lookup(name)\n\n"
		    "Return the variable bound to the symbol indicated by "
		    "name.  If there\nis no such binding or the symbol is not "
		    "bound to a variable, signal\nan error.") },
	{ "define",
	  (PyCFunction)define, METH_KEYWORDS,
	  PyDoc_STR("define(name, value)\n\n"
		    "Create a top level variable.  If the named variable "
		    "already exists,\njust change its value.") },
	{ "load",
	  (PyCFunction)load, METH_KEYWORDS,
	  PyDoc_STR("load(name)\n\n"
		    "Load a file and evaluate its contents "
		    "in the top-level environment.") },
	{ "eval_string",
	  (PyCFunction)eval_string, METH_KEYWORDS,
	  PyDoc_STR("eval_string(string)\n\n"
		    "Parse string as Scheme, and evaluate the expressions it "
开发者ID:rlutz,项目名称:geda-gaf,代码行数:32,代码来源:module.c


示例8: PyModule_GetName

        else {
            const char *name = PyModule_GetName(self);
            if (name)
                PyErr_Format(PyExc_TypeError,
                             "%.200s.__dict__ is not a dictionary",
                             name);
        }
    }

    Py_XDECREF(dict);
    return result;
}

static PyMethodDef module_methods[] = {
    {"__dir__", module_dir, METH_NOARGS,
     PyDoc_STR("__dir__() -> list\nspecialized dir() implementation")},
    {0}
};


PyDoc_STRVAR(module_doc,
"module(name[, doc])\n\
\n\
Create a module object.\n\
The name must be a string; the optional doc argument can have any type.");

PyTypeObject PyModule_Type = {
    PyVarObject_HEAD_INIT(&PyType_Type, 0)
    "module",                                   /* tp_name */
    sizeof(PyModuleObject),                     /* tp_size */
    0,                                          /* tp_itemsize */
开发者ID:IgnusIndia,项目名称:pythonexperiment,代码行数:31,代码来源:moduleobject.c


示例9: FillAttr_dealloc

	self->data.angle0 = angle0_arg;
	self->data.pitch0 = pitch0_arg;
	self->data.angle1 = angle1_arg;
	self->data.pitch1 = pitch1_arg;

	return 0;
}

static void FillAttr_dealloc(FillAttr *self)
{
	self->ob_type->tp_free((PyObject *)self);
}

static PyMemberDef FillAttr_members[] = {
	{ "type", T_INT, offsetof(FillAttr, data.type), 0,
	  PyDoc_STR("") },
	{ "width", T_DOUBLE, offsetof(FillAttr, data.width), 0,
	  PyDoc_STR("") },
	{ "angle0", T_INT, offsetof(FillAttr, data.angle0), 0,
	  PyDoc_STR("") },
	{ "pitch0", T_DOUBLE, offsetof(FillAttr, data.pitch0), 0,
	  PyDoc_STR("") },
	{ "angle1", T_INT, offsetof(FillAttr, data.angle1), 0,
	  PyDoc_STR("") },
	{ "pitch1", T_DOUBLE, offsetof(FillAttr, data.pitch1), 0,
	  PyDoc_STR("") },
	{ NULL }  /* Sentinel */
};

PyTypeObject FillAttrType = {
	PyObject_HEAD_INIT(NULL)
开发者ID:rlutz,项目名称:geda-gaf,代码行数:31,代码来源:data_fillattr.c


示例10: free

error:
  if(ops != &_tnetstring_ops_bytes) {
      free(ops);
      Py_DECREF(encoding);
  }
  Py_DECREF(object);
  return NULL;
}


static PyMethodDef _tnetstring_methods[] = {
    {"load",
     (PyCFunction)_tnetstring_load,
     METH_VARARGS,
     PyDoc_STR("load(file,encoding=None) -> object\n"
               "This function reads a tnetstring from a file and parses it\n"
               "into a python object.")},

    {"loads",
     (PyCFunction)_tnetstring_loads,
     METH_VARARGS,
     PyDoc_STR("loads(string,encoding=None) -> object\n"
               "This function parses a tnetstring into a python object.")},

    {"pop",
     (PyCFunction)_tnetstring_pop,
     METH_VARARGS,
     PyDoc_STR("pop(string,encoding=None) -> (object, remain)\n"
               "This function parses a tnetstring into a python object.\n"
               "It returns a tuple giving the parsed object and a string\n"
               "containing any unparsed data.")},
开发者ID:pombredanne,项目名称:tnetstring,代码行数:31,代码来源:_tnetstring.c


示例11: LRU_get_size

static PyObject *
LRU_get_size(LRU *self)
{
    return Py_BuildValue("i", self->size);
}

static PyObject *
LRU_get_stats(LRU *self)
{
    return Py_BuildValue("nn", self->hits, self->misses);
}

static PyMethodDef LRU_methods[] = {
    {"keys", (PyCFunction)LRU_keys, METH_NOARGS,
                    PyDoc_STR("L.keys() -> list of L's keys in MRU order")},
    {"values", (PyCFunction)LRU_values, METH_NOARGS,
                    PyDoc_STR("L.values() -> list of L's values in MRU order")},
    {"items", (PyCFunction)LRU_items, METH_NOARGS,
                    PyDoc_STR("L.items() -> list of L's items (key,value) in MRU order")},
    {"has_key",	(PyCFunction)LRU_contains, METH_VARARGS,
                    PyDoc_STR("L.has_key(key) -> Check if key is there in L")},
    {"get",	(PyCFunction)LRU_get, METH_VARARGS,
                    PyDoc_STR("L.get(key, instead) -> If L has key return its value, otherwise instead")},
    {"set_size", (PyCFunction)LRU_set_size, METH_VARARGS,
                    PyDoc_STR("L.set_size() -> set size of LRU")},
    {"get_size", (PyCFunction)LRU_get_size, METH_NOARGS,
                    PyDoc_STR("L.get_size() -> get size of LRU")},
    {"clear", (PyCFunction)LRU_clear, METH_NOARGS,
                    PyDoc_STR("L.clear() -> clear LRU")},
    {"get_stats", (PyCFunction)LRU_get_stats, METH_NOARGS,
开发者ID:pombredanne,项目名称:lru-dict,代码行数:30,代码来源:lru.c


示例12: PyErr_SetString

     * other than a string object. */
    if (value == NULL || !PyUnicode_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->gi_qualname;
    Py_INCREF(value);
    op->gi_qualname = value;
    Py_DECREF(tmp);
    return 0;
}

static PyGetSetDef gen_getsetlist[] = {
    {"__name__", (getter)gen_get_name, (setter)gen_set_name,
     PyDoc_STR("name of the generator")},
    {"__qualname__", (getter)gen_get_qualname, (setter)gen_set_qualname,
     PyDoc_STR("qualified name of the generator")},
    {NULL} /* Sentinel */
};

static PyMemberDef gen_memberlist[] = {
    {"gi_frame",     T_OBJECT, offsetof(PyGenObject, gi_frame),    READONLY},
    {"gi_running",   T_BOOL,   offsetof(PyGenObject, gi_running),  READONLY},
    {"gi_code",      T_OBJECT, offsetof(PyGenObject, gi_code),     READONLY},
    {NULL}      /* Sentinel */
};

static PyMethodDef gen_methods[] = {
    {"send",(PyCFunction)_PyGen_Send, METH_O, send_doc},
    {"throw",(PyCFunction)gen_throw, METH_VARARGS, throw_doc},
开发者ID:Alex9029,项目名称:cpython,代码行数:31,代码来源:genobject.c


示例13: PyMac_PRECHECK

#ifndef ComponentSetTarget
	PyMac_PRECHECK(ComponentSetTarget);
#endif
	if (!PyArg_ParseTuple(_args, "O&",
	                      CmpInstObj_Convert, &target))
		return NULL;
	_rv = ComponentSetTarget(_self->ob_itself,
	                         target);
	_res = Py_BuildValue("l",
	                     _rv);
	return _res;
}

static PyMethodDef CmpInstObj_methods[] = {
	{"CloseComponent", (PyCFunction)CmpInstObj_CloseComponent, 1,
	 PyDoc_STR("() -> None")},
	{"GetComponentInstanceError", (PyCFunction)CmpInstObj_GetComponentInstanceError, 1,
	 PyDoc_STR("() -> None")},
	{"SetComponentInstanceError", (PyCFunction)CmpInstObj_SetComponentInstanceError, 1,
	 PyDoc_STR("(OSErr theError) -> None")},
	{"GetComponentInstanceStorage", (PyCFunction)CmpInstObj_GetComponentInstanceStorage, 1,
	 PyDoc_STR("() -> (Handle _rv)")},
	{"SetComponentInstanceStorage", (PyCFunction)CmpInstObj_SetComponentInstanceStorage, 1,
	 PyDoc_STR("(Handle theStorage) -> None")},
	{"ComponentFunctionImplemented", (PyCFunction)CmpInstObj_ComponentFunctionImplemented, 1,
	 PyDoc_STR("(short ftnNumber) -> (long _rv)")},
	{"GetComponentVersion", (PyCFunction)CmpInstObj_GetComponentVersion, 1,
	 PyDoc_STR("() -> (long _rv)")},
	{"ComponentSetTarget", (PyCFunction)CmpInstObj_ComponentSetTarget, 1,
	 PyDoc_STR("(ComponentInstance target) -> (long _rv)")},
	{NULL, NULL, 0}
开发者ID:JupiterSmalltalk,项目名称:openqwaq,代码行数:31,代码来源:_Cmmodule.c


示例14: PyString_AsString

  if (!(result = PyString_FromStringAndSize(NULL,size)))
    return NULL;

  /* Second pass: actually decode this time. */

  out = PyString_AsString(result);
  size = percent_decode(in, inlen, out);

  return result;
}


static PyMethodDef Codec_methods[] = {
  {"encode",  (PyCFunction)Codec_encode,  METH_VARARGS,
    PyDoc_STR("encode(str) -> str")},
  {"decode",  (PyCFunction)Codec_decode,  METH_VARARGS,
    PyDoc_STR("decode(str) -> str")},
  {NULL,    NULL}    /* sentinel */
};


PyTypeObject CodecType = {
  /* The ob_type field must be initialized in the module init function
   * to be portable to Windows without using C++. */
  PyObject_HEAD_INIT(NULL)
  0,                            /*ob_size*/
  "percentcoding.cext.Codec",   /*tp_name*/
  sizeof(Codec),                /*tp_basicsize*/
  0,                            /*tp_itemsize*/
  /* methods */
开发者ID:acg,项目名称:python-percentcoding,代码行数:30,代码来源:codec.c


示例15: Py_DECREF

            Py_DECREF(res);
            return PyObject_RichCompare(self->data, other->data, opid);
        }
    }
    Py_RETURN_NOTIMPLEMENTED;
}

PyMappingMethods pysqlite_row_as_mapping = {
    /* mp_length        */ (lenfunc)pysqlite_row_length,
    /* mp_subscript     */ (binaryfunc)pysqlite_row_subscript,
    /* mp_ass_subscript */ (objobjargproc)0,
};

static PyMethodDef pysqlite_row_methods[] = {
    {"keys", (PyCFunction)pysqlite_row_keys, METH_NOARGS,
        PyDoc_STR("Returns the keys of the row.")},
    {NULL, NULL}
};


PyTypeObject pysqlite_RowType = {
        PyVarObject_HEAD_INIT(NULL, 0)
        MODULE_NAME ".Row",                             /* tp_name */
        sizeof(pysqlite_Row),                           /* tp_basicsize */
        0,                                              /* tp_itemsize */
        (destructor)pysqlite_row_dealloc,               /* tp_dealloc */
        (printfunc)pysqlite_row_print,                  /* tp_print */
        0,                                              /* tp_getattr */
        0,                                              /* tp_setattr */
        0,                                              /* tp_reserved */
        0,                                              /* tp_repr */
开发者ID:321543223,项目名称:kbengine,代码行数:31,代码来源:row.c


示例16: PyDoc_STR

 *  useful, but WITHOUT ANY WARRANTY; without even the implied warranty
 *  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser Public License
 *  along with the ZBar Bar Code Reader; if not, write to the Free
 *  Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 *  Boston, MA  02110-1301  USA
 *
 *  http://sourceforge.net/projects/zbar
 *------------------------------------------------------------------------*/

#include "zbarmodule.h"

static char decoder_doc[] = PyDoc_STR(
    "low level decode of measured bar/space widths.\n"
    "\n"
    "FIXME.");

static zbarDecoder*
decoder_new (PyTypeObject *type,
             PyObject *args,
             PyObject *kwds)
{
    static char *kwlist[] = { NULL };
    if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist))
        return(NULL);

    zbarDecoder *self = (zbarDecoder*)type->tp_alloc(type, 0);
    if(!self)
        return(NULL);
开发者ID:AleksandrRasskazov,项目名称:zbar,代码行数:31,代码来源:decoder.c


示例17: tupd_get_column_types

static PyObj
tupd_get_column_types(PyObj self, void *unused)
{
	return(PyPgTupleDesc_GetTypes(self));
}

static PyObj
tupd_get_pg_column_types(PyObj self, void *unused)
{
	return(PyPgTupleDesc_GetTypeOids(self));
}

static PyGetSetDef PyPgTupleDesc_GetSet[] = {
	{"column_types", tupd_get_column_types, NULL,
		PyDoc_STR("the descriptor's attribute types that have not been dropped")},
	{"pg_column_types", tupd_get_pg_column_types, NULL,
		PyDoc_STR("the descriptor's attribute type Oids that have not been dropped")},
	{NULL}
};

static PyMemberDef PyPgTupleDesc_Members[] = {
	{"column_names", T_OBJECT, offsetof(struct PyPgTupleDesc, td_names), READONLY,
		PyDoc_STR("the descriptor's attribute names that have not been dropped")},
	{"column_count", T_INT, offsetof(struct PyPgTupleDesc, td_natts), READONLY,
		PyDoc_STR("the count of the descriptor's attributes that have not been dropped ")},
	{NULL}
};

static Py_ssize_t
tupd_length(PyObj self)
开发者ID:fdr,项目名称:pg-python,代码行数:30,代码来源:tupledesc.c


示例18: Py_BuildValue

        }
        cur = Py_BuildValue("HKK", LCB_MUTATION_TOKEN_VB(mt),
            LCB_MUTATION_TOKEN_ID(mt), LCB_MUTATION_TOKEN_SEQ(mt));
        PyList_Append(ll, cur);
        Py_DECREF(cur);
    }

    return ll;
}


static PyGetSetDef Bucket_TABLE_getset[] = {
        { "default_format",
                (getter)Bucket_get_format,
                (setter)Bucket_set_format,
                PyDoc_STR("The default format to use for encoding values "
                "(passed to transcoder)")
        },
        { "server_nodes",
                (getter)Bucket_server_nodes,
                NULL,
                PyDoc_STR("Get a list of the current nodes in the cluster")
        },
        { "configured_replica_count",
                (getter)Bucket_get_configured_replica_count,
                NULL,
                PyDoc_STR("Get the number of configured replicas for the bucket")
        },

        { "transcoder",
                (getter)Bucket_get_transcoder,
                (setter)Bucket_set_transcoder,
开发者ID:kvikas,项目名称:couchbase-python-client,代码行数:32,代码来源:bucket.c


示例19: Py_XDECREF

    Py_XDECREF(self->x_attr);
    PyObject_Del(self);
}

static PyObject *
Xxo_demo(XxoObject *self, PyObject *args)
{
    if (!PyArg_ParseTuple(args, ":demo"))
        return NULL;
    Py_INCREF(Py_None);
    return Py_None;
}

static PyMethodDef Xxo_methods[] = {
    {"demo",            (PyCFunction)Xxo_demo,  METH_VARARGS,
        PyDoc_STR("demo() -> None")},
    {NULL,              NULL}           /* sentinel */
};

static PyObject *
Xxo_getattr(XxoObject *self, char *name)
{
    if (self->x_attr != NULL) {
        PyObject *v = PyDict_GetItemString(self->x_attr, name);
        if (v != NULL) {
            Py_INCREF(v);
            return v;
        }
    }
    return Py_FindMethod(Xxo_methods, (PyObject *)self, name);
}
开发者ID:AbnerChang,项目名称:edk2-staging,代码行数:31,代码来源:xxmodule.c


示例20: Py_XSETREF

    Py_XSETREF(op->gi_qualname, value);
    return 0;
}

static PyObject *
gen_getyieldfrom(PyGenObject *gen)
{
    PyObject *yf = _PyGen_yf(gen);
    if (yf == NULL)
        Py_RETURN_NONE;
    return yf;
}

static PyGetSetDef gen_getsetlist[] = {
    {"__name__", (getter)gen_get_name, (setter)gen_set_name,
     PyDoc_STR("name of the generator")},
    {"__qualname__", (getter)gen_get_qualname, (setter)gen_set_qualname,
     PyDoc_STR("qualified name of the generator")},
    {"gi_yieldfrom", (getter)gen_getyieldfrom, NULL,
     PyDoc_STR("object being iterated by yield from, or None")},
    {NULL} /* Sentinel */
};

static PyMemberDef gen_memberlist[] = {
    {"gi_frame",     T_OBJECT, offsetof(PyGenObject, gi_frame),    READONLY},
    {"gi_running",   T_BOOL,   offsetof(PyGenObject, gi_running),  READONLY},
    {"gi_code",      T_OBJECT, offsetof(PyGenObject, gi_code),     READONLY},
    {NULL}      /* Sentinel */
};

static PyMethodDef gen_methods[] = {
开发者ID:DinoV,项目名称:gilectomy,代码行数:31,代码来源:genobject.c



注:本文中的PyDoc_STR函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PyErr_BadArgument函数代码示例发布时间:2022-05-30
下一篇:
C++ PyDict_Size函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap