[chirp_devel] [PATCH 2 of 4] [FT857] Protected a debugging print by CHIRP_DEBUG environment variable

Marco Filippi IZ3GME
Thu Apr 19 11:20:45 PDT 2012


# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1334855503 -7200
# Node ID ae94b6acc167801f60f24fec8f06f8ec80331df0
# Parent  7f126e9a9ddf42dd132a463a9d7a9e144bafc436
[FT857] Protected a debugging print by CHIRP_DEBUG environment variable
Fix Bug #134

diff -r 7f126e9a9ddf -r ae94b6acc167 chirp/ft857.py
--- a/chirp/ft857.py	gio apr 19 08:36:33 2012 +0200
+++ b/chirp/ft857.py	gio apr 19 19:11:43 2012 +0200
@@ -16,6 +16,7 @@
 
 from chirp import ft817, chirp_common, errors, directory
 from chirp import bitwise
+import os
 
 mem_format = """
 struct mem_struct{
@@ -226,7 +227,8 @@
 
 	bitindex = -38 - mem.number
         used = ((self._memobj.pmsvisible & self._memobj.pmsfilled) >> bitindex) & 0x01
-	print "mem.number %i bitindex %i pmsvisible %i pmsfilled %i used %i" % (mem.number, bitindex, self._memobj.pmsvisible, self._memobj.pmsfilled, used)
+        if os.getenv("CHIRP_DEBUG"):
+	    print "mem.number %i bitindex %i pmsvisible %i pmsfilled %i used %i" % (mem.number, bitindex, self._memobj.pmsvisible, self._memobj.pmsfilled, used)
         if not used:
             mem.empty = True
             return mem



More information about the chirp_devel mailing list