Skip to content

Commit

Permalink
build update
Browse files Browse the repository at this point in the history
  • Loading branch information
fabrizio8 authored and theyoyojo committed Nov 14, 2019
1 parent dd85eb4 commit bb944bf
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
5 changes: 2 additions & 3 deletions RPi/_GPIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@

# Internal library state
class _State:
mode = UNKNOWN
mode = UNKNOWN
warnings = True
debuginfo = True
debuginfo = False
chip = None
event_ls = []
lines = {}
Expand Down Expand Up @@ -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")

Expand Down
12 changes: 10 additions & 2 deletions SPECS/libgpiod.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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 <fedora-rpi@googlegroups.com>
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/

10 changes: 10 additions & 0 deletions tests/test_python3-libgpiod-rpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bb944bf

Please sign in to comment.