[gnome-lirc-properties] Fix TODO item wrt. magic numbers



commit a987b3acb3110793a6f7d0d0a40346e2479c4f1e
Author: Bastien Nocera <hadess hadess net>
Date:   Wed May 26 16:58:42 2010 +0100

    Fix TODO item wrt. magic numbers

 gnome_lirc_properties/lirc.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome_lirc_properties/lirc.py b/gnome_lirc_properties/lirc.py
index f4225a1..e325826 100644
--- a/gnome_lirc_properties/lirc.py
+++ b/gnome_lirc_properties/lirc.py
@@ -807,8 +807,8 @@ class KeyListener(gobject.GObject):
             logging.info('reading from lirc socket %d...', fd)
 
             try:
-              # TODO: What is this 128? No magic numbers in code, please.
-              packet = self.__socket and self.__socket.recv(128)
+              BUFFER_SIZE = 128
+              packet = self.__socket and self.__socket.recv(BUFFER_SIZE)
             except SocketError, ex:
               logging.error('__on_io_event(): socket.recv() threw exception reading from lirc socket: %s', ex.message)
               packet = ''



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]