diff options
Diffstat (limited to 'src/portal/cpy')
| -rwxr-xr-x | src/portal/cpy/build.sh | 2 | ||||
| -rw-r--r-- | src/portal/cpy/portal.pyx | 8 | ||||
| -rw-r--r-- | src/portal/cpy/post.pxd | 6 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/portal/cpy/build.sh b/src/portal/cpy/build.sh index 45a47f5..15ff4f5 100755 --- a/src/portal/cpy/build.sh +++ b/src/portal/cpy/build.sh @@ -1,3 +1,3 @@ #! /usr/bin/env sh export PYTHONDONTWRITEBYTECODE=1 -python3.12 setup.py build_ext -i +python3 setup.py build_ext -i diff --git a/src/portal/cpy/portal.pyx b/src/portal/cpy/portal.pyx index 3ddde80..ec33ac6 100644 --- a/src/portal/cpy/portal.pyx +++ b/src/portal/cpy/portal.pyx @@ -24,7 +24,7 @@ def encode_str(str): def decode_str(str): return str.decode('UTF-8') -class LogOutputHook(object): +class OutputHook(object): def __init__(self): self.fd = sys.__stdout__ @@ -35,7 +35,7 @@ class LogOutputHook(object): if len(msg) > 0 and msg != '\n': log_info(encode_str(msg)) -hook = LogOutputHook() +hook = OutputHook() sys.stdout = hook sys.stderr = hook @@ -147,8 +147,8 @@ cdef public int add_post_internal(bridge.camu_search *search, int id, unsigned i bridge.camu_search_add_post(search, num, &cpost) return 0 py_str_to_str(&cpost.url, encode_str(py_post.url)) - for type, date in py_post.dates.items(): - post.camu_post_add_date(&cpost, type.value, date) + for date in py_post.dates: + post.camu_post_add_date(&cpost, date.type, date.range[0], date.range[1], date.meta) py_str_to_str(&cpost.author.unique_id, encode_str(py_post.author.unique_id)) py_str_to_wstr(&cpost.author.username, encode_str(py_post.author.username)) py_str_to_wstr(&cpost.author.display_name, encode_str(py_post.author.display_name)) diff --git a/src/portal/cpy/post.pxd b/src/portal/cpy/post.pxd index 3f66508..aae9839 100644 --- a/src/portal/cpy/post.pxd +++ b/src/portal/cpy/post.pxd @@ -7,7 +7,9 @@ cdef extern from "../src/post.h": cdef struct camu_post_date: u8 type - f32 timestamp + f32 range_start + f32 range_end + u32 meta ctypedef struct camu_dates_array: u32 size @@ -57,5 +59,5 @@ cdef extern from "../src/post.h": camu_post_ref in_reply_to void camu_post_reset(camu_post *post) - void camu_post_add_date(camu_post *post, u8 type, f32 timestamp) + void camu_post_add_date(camu_post *post, u8 type, f32 range_start, f32 range_end, u32 meta) void camu_post_add_media(camu_post *post, u8 type, str *key, str *url, str *ext, str *thumbnail_url, str *thumbnail_ext) |