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
7c9129b0
Commit
7c9129b0
authored
May 19, 2015
by
Vincent Castellano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tgl_Msg class
parent
25ed2042
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
427 additions
and
102 deletions
+427
-102
python-tg.h
python-tg.h
+6
-0
python-types.c
python-types.c
+412
-100
python-types.h
python-types.h
+8
-1
tg-test.py
tg-test.py
+1
-1
No files found.
python-tg.h
View file @
7c9129b0
...
...
@@ -21,6 +21,7 @@
#define __PYTHON_TG_H__
#include <string.h>
#include <Python.h>
#include <tgl/tgl.h>
void
py_init
(
const
char
*
file
);
...
...
@@ -32,4 +33,9 @@ void py_chat_update (struct tgl_chat *C, unsigned flags);
void
py_binlog_end
(
void
);
void
py_diff_end
(
void
);
void
py_do_all
(
void
);
void
py_add_string_field
(
PyObject
*
dict
,
char
*
name
,
const
char
*
value
);
void
py_add_string_field_arr
(
PyObject
*
list
,
int
num
,
const
char
*
value
);
void
py_add_num_field
(
PyObject
*
dict
,
const
char
*
name
,
double
value
);
#endif
python-types.c
View file @
7c9129b0
This diff is collapsed.
Click to expand it.
python-types.h
View file @
7c9129b0
...
...
@@ -6,9 +6,16 @@
typedef
struct
{
PyObject_HEAD
tgl_peer_t
peer
;
tgl_peer_t
*
peer
;
}
tgl_Peer
;
typedef
struct
{
PyObject_HEAD
struct
tgl_message
*
msg
;
}
tgl_Msg
;
PyObject
*
tgl_Peer_FromTglPeer
(
tgl_peer_t
*
peer
);
PyObject
*
tgl_Msg_FromTglMsg
(
struct
tgl_message
*
peer
);
#endif
tg-test.py
View file @
7c9129b0
...
...
@@ -35,7 +35,7 @@ def on_msg_receive(msg):
if
msg
[
"out"
]
and
not
binlog_done
:
return
;
print
(
msg
[
"to"
]
.
user_
id
)
print
(
msg
[
"to"
]
.
id
)
"""
def on_msg_receive(msg):
...
...
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