diff --git a/RPi/_GPIO.py b/RPi/_GPIO.py index a458bda..9ff6085 100644 --- a/RPi/_GPIO.py +++ b/RPi/_GPIO.py @@ -55,9 +55,9 @@ # Internal library state class _State: -mode = UNKNOWN + mode = UNKNOWN warnings = True - debuginfo = True + debuginfo = False chip = None event_ls = [] lines = {} @@ -313,7 +313,6 @@ def output(channel, value): for chan in channel: chan = channel_fix_and_validate(chan) - print("is_all_ints=", is_all_ints(value), "for value=", value) if (not is_all_ints(value)) and (not is_all_bools(value)): raise ValueError("Value must be an integer/boolean or a list/tuple of integers/booleans") diff --git a/SPECS/libgpiod.spec b/SPECS/libgpiod.spec index eb7496d..1a87fc9 100644 --- a/SPECS/libgpiod.spec +++ b/SPECS/libgpiod.spec @@ -7,18 +7,26 @@ Version: 1.0 Release: 1 License: GPLv3 #Group: -#Source: ftp://ftp.gnomovision.com/pub/cdplayer/cdplayer-1.0.tgz +Source: https://github.com/underground-software/libgpiod-rpi #URL: http://www.gnomovision.com/cdplayer/cdplayer.html Distribution: Fedora 30 Linux Packager: UML Fedora RPI +Requires: libgpiod-python + %description This project implements a compatibility layer between RPi.GPIO syntax and libgpiod semantics. %prep +%autosetup rm -rf $RPM_BUILD_DIR/python3-libgpiod-rpi tar xf $RPM_SOURCE_DIR/python3-libgpiod-rpi.tar.gz -%build +%install +cp $RPM_SOURCE_DIR/* /usr/lib64/python3.7/site-packages +%files +%license LICENSE +%doc README.md +%{python3_sitearch}/gpiod-rpi/ diff --git a/tests/test_python3-libgpiod-rpi.py b/tests/test_python3-libgpiod-rpi.py index 4ac695d..94b2294 100644 --- a/tests/test_python3-libgpiod-rpi.py +++ b/tests/test_python3-libgpiod-rpi.py @@ -346,3 +346,13 @@ def test_gpio_function(): GPIO.setmode(GPIO.BOARD) assert GPIO.gpio_function(16) == 11 + +def test_setdebuginfo(): + GPIO_DEVEL.Reset() + + # Off by default + assert GPIO_DEVEL.State_Access().debuginfo == False + + GPIO_DEVEL.setdebuginfo(True) + + assert GPIO_DEVEL.State_Access().debuginfo == True