Fix python binding for future deprecation of distutils.sysconfig

Hopefully works on MacOS
Also hopefully works on python2
https://github.com/Hamlib/Hamlib/issues/477
pull/608/head
Michael Black W9MDB 2021-03-08 23:26:44 -06:00
rodzic 5bebf5ad45
commit 0f0705d014
5 zmienionych plików z 17 dodań i 4 usunięć

Wyświetl plik

@ -3,7 +3,7 @@
# more information on swig at http://www.swig.org
#
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/bindings $(PYTHON_CPPFLAGS) \
AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/include -I$(top_srcdir)/bindings \
$(TCL_INCLUDE_SPEC)
AM_CFLAGS = -fno-strict-aliasing

Wyświetl plik

@ -194,6 +194,7 @@
%ignore rig_passband_normal;
%ignore rig_passband_narrow;
%ignore rig_passband_wide;
%ignore rig_get_vfo_info;
%ignore rot_open;
%ignore rot_close;

Wyświetl plik

@ -39,7 +39,7 @@ def StartUp():
print("freq:\t\t\t%s" % my_rig.get_freq())
my_rig.set_freq(Hamlib.RIG_VFO_A, 145550000)
(mode, width) = my_rig.get_mode()
(mode, width) = my_rig.get_mode(Hamlib.RIG_VFO_A)
print("mode:\t\t\t%s\nbandwidth:\t\t%s" % (Hamlib.rig_strrmode(mode), width))
@ -83,6 +83,9 @@ def StartUp():
print("get_channel status:\t%s" % my_rig.error_status)
print("VFO:\t\t\t%s, %s" % (Hamlib.rig_strvfo(chan.vfo), chan.freq))
print("Attenuators:\t\t%s" % my_rig.caps.attenuator)
# Can't seem to get get_vfo_info to work
#(freq, width, mode, split) = my_rig.get_vfo_info(Hamlib.RIG_VFO_A,freq,width,mode,split)
#print("Rig vfo_info:\t\tfreq=%s, mode=%s, width=%s, split=%s" % (freq, mode, width, split))
print("\nSending Morse, '73'")
my_rig.send_morse(Hamlib.RIG_VFO_A, "73")

Wyświetl plik

@ -70,6 +70,10 @@ typedef channel_t * const_channel_t_p;
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1); }
#define METHOD3_INIT(f, t1, t2, t3, i3) void f (t1 _##t1##_1, t2 _##t2##_2, t3 _##t3##_3 = i3 _VFO_DECL) \
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1##_1, _##t2##_2, _##t3##_3); }
#define METHOD4(f, t1) void f ( vfo_t vfo, t1 _##t1) \
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1); }
#define METHOD4_INIT(f, t1, t2, t3, t4, i4) void f (t1 _##t1##_1, t2 _##t2##_2, t3 _##t3##_3, ##t4##_4 = i4 _VFO_DECL) \
{ self->error_status = rig_##f(self->rig _VFO_ARG, _##t1##_1, _##t2##_2, _##t3##_3 _##t4##_4); }
/*
* declare wrapper method with one output argument besides RIG* (no target vfo)
*/
@ -445,6 +449,7 @@ typedef channel_t * const_channel_t_p;
METHOD1VGET(get_xit, shortfreq_t)
METHOD1VGET(get_ts, shortfreq_t)
extern void get_ant(ant_t *ant_rx, ant_t *ant_tx, ant_t *ant_curr, value_t * OUTPUT, ant_t ant, vfo_t vfo = RIG_VFO_CURR);
extern void get_vfo_info (split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo = RIG_VFO_CURR);
METHOD1VGET(get_mem, int)
METHOD1GET(get_powerstat, powerstat_t)
METHOD1GET(get_trn, int)
@ -600,6 +605,11 @@ void Rig_get_ant(Rig *self, ant_t *ant_rx, ant_t *ant_tx, ant_t *ant_curr, value
{
self->error_status = rig_get_ant(self->rig, vfo, ant, option, ant_curr, ant_tx, ant_rx);
}
void Rig_get_vfo_info (Rig *self, split_t *split, pbwidth_t *width, rmode_t *mode, freq_t *freq, vfo_t vfo)
{
self->error_status = rig_get_vfo_info(self->rig, vfo, freq, mode, width, split);
}
struct channel *Rig_get_chan_all(Rig *self)
{
@ -618,4 +628,5 @@ struct channel *Rig_get_chan_all(Rig *self)
return chans;
}
%}

Wyświetl plik

@ -2339,11 +2339,9 @@ extern HAMLIB_EXPORT(int)
rig_get_vfo HAMLIB_PARAMS((RIG *rig,
vfo_t *vfo));
#if 0
extern HAMLIB_EXPORT(int)
rig_get_vfo_info HAMLIB_PARAMS((RIG *rig,
vfo_t vfo, freq_t *freq, rmode_t *mode, pbwidth_t *width, split_t *split));
#endif
extern HAMLIB_EXPORT(int)
rig_get_vfo_list HAMLIB_PARAMS((RIG *rig, char *buf, int buflen));