rpms/python-lirc/FC-6 python-lirc-API, NONE, 1.1 python-lirc-README, NONE, 1.1 python-lirc-sample-multithread.py, NONE, 1.1 python-lirc-sample-simple.py, NONE, 1.1 python-lirc.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Matthias Saou (thias) fedora-extras-commits at redhat.com
Thu Mar 1 18:46:07 UTC 2007


Author: thias

Update of /cvs/extras/rpms/python-lirc/FC-6
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22207/FC-6

Modified Files:
	.cvsignore sources 
Added Files:
	python-lirc-API python-lirc-README 
	python-lirc-sample-multithread.py python-lirc-sample-simple.py 
	python-lirc.spec 
Log Message:
Import all non-devel branches, use downloads.sf.net and add needed explicit python-abi requirement for EL-4.



--- NEW FILE python-lirc-API ---
API
===

Initialization
--------------

Before you can receive any commands from lirc, you'll need to initialize the module. After importing pyLirc, call the pylirc.init() function:

import pylirc

integer = pylirc.init(string name[, string configuration [, integer blocking ]])

the returnvalue is the returnvalue of lircs client library
lirc_init(), ie a socket, or zero on failure.

The socket can be used with select.select() to wait for data if you don't want to use blocking. This is especially useful in multithreaded programs as blocking mode of pylirc will block all threads, whereas select() will only block the current and with optional timeout.

name: the name used for your program in the lirc configuration file, must be supplied.

configuration: a filename to a lirc configuration file in case you wish not to use lircs default configuration file (usually ~/.lircrc).

blocking: a flag indicating whether you want blocking mode or not. See also blocking() and select.select() (latter in python docs)


Polling
-------

If initialization was ok, you can poll lirc for commands. To read any commands in queue call pylirc.nextcode():

list = pylirc.nextcode([integer Exteneded])

The returnvalue is 'None', if no commands were in the queue, or a list containing the commands read.


To get the commands one by one enumerate the list:

for code in list:
print code

If you supply the optional argument Extended as true, code will be a dictionary otherwise it will be a string (old behaviour).

The dictionary currently contains:
"config": The config string from lirc config file - the same string you'd get in non-extended mode.
"repeat": The repeat count of the buttonpress.

Note, that there can still be more commands on queue after a call to pylirc.nextcode(). You should call it in a loop until you get 'None' back.


Exiting
-------

When you're done using pyLirc and before you exit your program you should clean up:

pylirc.exit()


Changing mode
-------------

When you initialize pyLirc, you can chose whether you want blocking or non-blocking mode. Blocking mode means pylirc.nextcode() waits until there is a command to be read until it returns.
To change mode after initialization, use blocking():

success = pylirc.blocking(int)



--- NEW FILE python-lirc-README ---
python-lirc (pylirc) rpm packages

LICENSE
=======

The original sources are licensed under the GNU LGPL, but since we are
packaging them linked against the lirc libraries, which are licensed under the
GNU GPL, we had to relicense the resulting packages under the GNU GPL.

DOCUMENTATION
=============

The original sources do not contain any documentation, but the API document as
well as two usage examples from the pylirc website have been included in the
packages.



***** Error reading new file: [Errno 2] No such file or directory: 'python-lirc-sample-multithread.py'

***** Error reading new file: [Errno 2] No such file or directory: 'python-lirc-sample-simple.py'

--- NEW FILE python-lirc.spec ---
%define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")

Summary: Linux Infrared Remote Control python module
Name: python-lirc
Version: 0.0.5
Release: 3%{?dist}
License: GPL
Group: Development/Languages
URL: http://pylirc.mccabe.nu/
Source0: http://downloads.sf.net/pylirc/pylirc-%{version}.tar.gz
Source1: python-lirc-README
Source2: python-lirc-API
Source3: python-lirc-sample-simple.py
Source4: python-lirc-sample-multithread.py
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: python-devel, lirc-devel
Provides: pylirc = %{version}-%{release}

%description
pyLirc is a module for Python that interacts with lirc to give Python programs
the ability to receive commands from remote controls.


%prep
%setup -q -n pylirc-%{version}


%build
CFLAGS="%{optflags}" %{__python} setup.py build


%install
%{__rm} -rf %{buildroot}
%{__python} setup.py install -O1 --skip-build --root %{buildroot}
# Install our docs for later inclusion with %%doc
%{__install} -p -m 0644 %{SOURCE1} README
%{__install} -p -m 0644 %{SOURCE2} API
%{__install} -p -m 0644 %{SOURCE3} sample-simple.py
%{__install} -p -m 0644 %{SOURCE4} sample-multithread.py


%clean
%{__rm} -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc API PKG-INFO README sample-simple.py sample-multithread.py
%{python_sitearch}/pylircmodule.so


%changelog
* Thu Mar  1 2007 Matthias Saou <http://freshrpms.net/> 0.0.5-3
- Prefix all our own documentation source files.
- Include a README about our license changes and added docs.

* Thu Feb  8 2007 Matthias Saou <http://freshrpms.net/> 0.0.5-2
- Change License from GPL to LGPL as our package links with lirc which is GPL.
- Add pylirc (original name) virtual provides.
- Include the API doc and both examples from the website.

* Thu Feb  8 2007 Matthias Saou <http://freshrpms.net/> 0.0.5-1
- Initial RPM release.



Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/python-lirc/FC-6/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	1 Mar 2007 16:45:27 -0000	1.1
+++ .cvsignore	1 Mar 2007 18:45:33 -0000	1.2
@@ -0,0 +1 @@
+pylirc-0.0.5.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/python-lirc/FC-6/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	1 Mar 2007 16:45:27 -0000	1.1
+++ sources	1 Mar 2007 18:45:33 -0000	1.2
@@ -0,0 +1 @@
+4e3b6b50485610e273fededdb25b47ad  pylirc-0.0.5.tar.gz




More information about the scm-commits mailing list