Skip to content

Commit b0508fc

Browse files
authored
Merge pull request #1564 from somechris/python-priv-drop
bindings/python: Add priv_drop_user and priv_drop_group
2 parents f7bcb9d + a18883c commit b0508fc

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

bindings/python/rgbmatrix/core.pxd

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ cdef class RGBMatrixOptions:
1919
cdef bytes __py_encoded_led_rgb_sequence
2020
cdef bytes __py_encoded_pixel_mapper_config
2121
cdef bytes __py_encoded_panel_type
22+
cdef bytes __py_encoded_drop_priv_user
23+
cdef bytes __py_encoded_drop_priv_group
2224

2325
# Local Variables:
2426
# mode: python

bindings/python/rgbmatrix/core.pyx

+12
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,18 @@ cdef class RGBMatrixOptions:
192192
def __get__(self): return self.__runtime_options.drop_privileges
193193
def __set__(self, uint8_t value): self.__runtime_options.drop_privileges = value
194194

195+
property drop_priv_user:
196+
def __get__(self): return self.__runtime_options.drop_priv_user
197+
def __set__(self, value):
198+
self.__py_encoded_drop_priv_user = value.encode('utf-8')
199+
self.__runtime_options.drop_priv_user = self.__py_encoded_drop_priv_user
200+
201+
property drop_priv_group:
202+
def __get__(self): return self.__runtime_options.drop_priv_group
203+
def __set__(self, value):
204+
self.__py_encoded_drop_priv_group = value.encode('utf-8')
205+
self.__runtime_options.drop_priv_group = self.__py_encoded_drop_priv_group
206+
195207
cdef class RGBMatrix(Canvas):
196208
def __cinit__(self, int rows = 0, int chains = 0, int parallel = 0,
197209
RGBMatrixOptions options = None):

bindings/python/rgbmatrix/cppinc.pxd

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ cdef extern from "led-matrix.h" namespace "rgb_matrix":
3535
int gpio_slowdown
3636
int daemon
3737
int drop_privileges
38+
const char *drop_priv_user
39+
const char *drop_priv_group
3840

3941

4042
RGBMatrix *CreateMatrixFromOptions(Options &options, RuntimeOptions runtime_options)

0 commit comments

Comments
 (0)