Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
ff704275
Commit
ff704275
authored
Jun 02, 2015
by
Vincent Castellano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement msg.load_*
parent
49951819
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
0 deletions
+57
-0
python-types.c
python-types.c
+57
-0
No files found.
python-types.c
View file @
ff704275
...
@@ -1221,6 +1221,8 @@ tgl_Msg_gettext (tgl_Msg *self, void *closure)
...
@@ -1221,6 +1221,8 @@ tgl_Msg_gettext (tgl_Msg *self, void *closure)
return
ret
;
return
ret
;
}
}
static
PyObject
*
static
PyObject
*
tgl_Msg_getmedia
(
tgl_Msg
*
self
,
void
*
closure
)
tgl_Msg_getmedia
(
tgl_Msg
*
self
,
void
*
closure
)
{
{
...
@@ -1368,6 +1370,55 @@ tgl_Msg_getreply_id (tgl_Msg *self, void *closure)
...
@@ -1368,6 +1370,55 @@ tgl_Msg_getreply_id (tgl_Msg *self, void *closure)
return
ret
;
return
ret
;
}
}
// All load methods are implemented the same, just alias load_document
static
PyObject
*
tgl_Msg_load_document
(
tgl_Msg
*
self
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
static
char
*
kwlist
[]
=
{
"callback"
,
NULL
};
PyObject
*
callback
=
NULL
;
if
(
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O"
,
kwlist
,
&
callback
))
{
PyObject
*
api_call
;
api_call
=
Py_BuildValue
(
"OO"
,
(
PyObject
*
)
self
,
callback
);
Py_INCREF
(
Py_None
);
Py_XINCREF
(
api_call
);
return
py_load_document
(
Py_None
,
api_call
);
}
else
{
PyErr_Print
();
Py_XINCREF
(
Py_False
);
return
Py_False
;
}
}
static
PyObject
*
tgl_Msg_load_document_thumb
(
tgl_Msg
*
self
,
PyObject
*
args
,
PyObject
*
kwargs
)
{
static
char
*
kwlist
[]
=
{
"callback"
,
NULL
};
PyObject
*
callback
=
NULL
;
if
(
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O"
,
kwlist
,
&
callback
))
{
PyObject
*
api_call
;
api_call
=
Py_BuildValue
(
"OO"
,
(
PyObject
*
)
self
,
callback
);
Py_INCREF
(
Py_None
);
Py_XINCREF
(
api_call
);
return
py_load_document_thumb
(
Py_None
,
api_call
);
}
else
{
PyErr_Print
();
Py_XINCREF
(
Py_False
);
return
Py_False
;
}
}
static
PyObject
*
static
PyObject
*
tgl_Msg_repr
(
tgl_Msg
*
self
)
tgl_Msg_repr
(
tgl_Msg
*
self
)
{
{
...
@@ -1422,6 +1473,12 @@ static PyMemberDef tgl_Msg_members[] = {
...
@@ -1422,6 +1473,12 @@ static PyMemberDef tgl_Msg_members[] = {
static
PyMethodDef
tgl_Msg_methods
[]
=
{
static
PyMethodDef
tgl_Msg_methods
[]
=
{
{
"load_document"
,
(
PyCFunction
)
tgl_Msg_load_document
,
METH_VARARGS
|
METH_KEYWORDS
,
""
},
{
"load_photo"
,
(
PyCFunction
)
tgl_Msg_load_document
,
METH_VARARGS
|
METH_KEYWORDS
,
""
},
{
"load_audio"
,
(
PyCFunction
)
tgl_Msg_load_document
,
METH_VARARGS
|
METH_KEYWORDS
,
""
},
{
"load_video"
,
(
PyCFunction
)
tgl_Msg_load_document
,
METH_VARARGS
|
METH_KEYWORDS
,
""
},
{
"load_document_thumb"
,
(
PyCFunction
)
tgl_Msg_load_document_thumb
,
METH_VARARGS
|
METH_KEYWORDS
,
""
},
{
"load_video_thumb"
,
(
PyCFunction
)
tgl_Msg_load_document_thumb
,
METH_VARARGS
|
METH_KEYWORDS
,
""
},
{
NULL
}
/* Sentinel */
{
NULL
}
/* Sentinel */
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment