From 102a1199716bd8e33bc720bd42fab4651a11f276 Mon Sep 17 00:00:00 2001 From: Brett Dutro Date: Wed, 24 Apr 2024 14:43:23 -0500 Subject: [PATCH] Fix errors when compiling Argos with the latest Cython - Fixes `NameError: name 'extract_value' is not defined` error - Fixes segfault when trying to start Argos Fixes #465, #490, #492 --- helios/pipeViewer/pipe_view/core/src/core.pyx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/helios/pipeViewer/pipe_view/core/src/core.pyx b/helios/pipeViewer/pipe_view/core/src/core.pyx index 57a6f18257..952ec2a041 100644 --- a/helios/pipeViewer/pipe_view/core/src/core.pyx +++ b/helios/pipeViewer/pipe_view/core/src/core.pyx @@ -7,9 +7,6 @@ import math import colorsys from logging import debug, error, info -# Color expression namespace -EXPR_NAMESPACE = {'re':re, 'colorsys':colorsys, 'math':math, 'extract':extract_value} - from common cimport * from libc.stdlib cimport strtoul from libcpp.unordered_map cimport unordered_map @@ -203,6 +200,9 @@ cdef wxFont* getFont(font): cdef wxBrush* getBrush(brush): return getBrush_wrapped(brush) +# Color expression namespace +EXPR_NAMESPACE = {'re':re, 'colorsys':colorsys, 'math':math, 'extract':extract_value} + cdef class Renderer: cdef unordered_map[int, wxPen] c_pens_map @@ -406,7 +406,8 @@ cdef class Renderer: return string_to_display, wx.TheBrushList.FindOrCreateBrush(wx.WHITE, wx.SOLID) def setFontFromDC(self, dc): - self.c_font = getFont(dc.GetFont())[0] + py_font = dc.GetFont() + self.c_font = getFont(py_font)[0] self.c_bold_font = wxFont(self.c_font) self.c_bold_font.MakeBold()