From 0269a9477c585a7f337a56607bcbd77cc5a5d715 Mon Sep 17 00:00:00 2001 From: tmraz Date: Sep 05 2005 08:06:44 +0000 Subject: - fixed a few errors catched by pychecker --- diff --git a/authconfig-gtk.py b/authconfig-gtk.py index ba164c8..36b1db0 100755 --- a/authconfig-gtk.py +++ b/authconfig-gtk.py @@ -257,7 +257,7 @@ class Authconfig: option = getattr(self.info, map[entry][0]) if option not in options: if option != '': - widget.prepend_text(item) + widget.prepend_text(option) widget.set_active(0) options.insert(0, option) widget.set_data("option_list", options) diff --git a/authconfig.py b/authconfig.py index a556c65..4ef18e1 100755 --- a/authconfig.py +++ b/authconfig.py @@ -204,17 +204,17 @@ class Authconfig: parser.parse_args(["-h"]) def probe(self): - authinfo = authinfo.AuthInfo() - authinfo.probe() - if authinfo.hesiodLHS and authinfo.hesiodRHS: - print "hesiod %s/%s" % (authinfo.hesiodLHS, - authinfo.hesiodRHS) - if authinfo.ldapServer and authinfo.ldapBaseDN: - print "ldap %s/%s\n" % (authinfo.ldapServer, - authinfo.ldapBaseDN) - if authinfo.kerberosRealm: - print "krb5 %s/%s/%s\n" % (authinfo.kerberosRealm, - authinfo.kerberosKDC or "", authinfo.kerberosAdminServer or "") + info = authinfo.AuthInfo() + info.probe() + if info.hesiodLHS and info.hesiodRHS: + print "hesiod %s/%s" % (info.hesiodLHS, + info.hesiodRHS) + if info.ldapServer and info.ldapBaseDN: + print "ldap %s/%s\n" % (info.ldapServer, + info.ldapBaseDN) + if info.kerberosRealm: + print "krb5 %s/%s/%s\n" % (info.kerberosRealm, + info.kerberosKDC or "", info.kerberosAdminServer or "") def readAuthInfo(self): self.info = authinfo.read() diff --git a/authconfig.spec.in b/authconfig.spec.in index dc3ab54..36a2e47 100644 --- a/authconfig.spec.in +++ b/authconfig.spec.in @@ -88,6 +88,9 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pixmaps/* %changelog +* Mon Sep 5 2005 Tomas Mraz - 5.0.1-1 +- fixed a few errors catched by pychecker + * Sat Sep 3 2005 Tomas Mraz - 5.0.0-1 - C code completely rewritten in Python - some bugs fixed in the process (and no doubt new introduced) diff --git a/authinfo.py b/authinfo.py index dac4898..4b3c17c 100644 --- a/authinfo.py +++ b/authinfo.py @@ -142,6 +142,7 @@ def checkNSS(configuration, candidate): if start < len(configuration) and configuration[start].isalnum(): continue return True + return False def openLocked(filename, perms): fd = -1 @@ -1858,6 +1859,7 @@ class AuthInfo: wrotetemplateh = False wrotetemplatep = False wrotetemplates = False + wroteusedefaultdomain = False f = None output = "" try: diff --git a/configure.in b/configure.in index c59d6c7..36d4697 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -AC_INIT(authconfig,5.0.0) +AC_INIT(authconfig,5.0.1) AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip]) AC_PREFIX_DEFAULT(/usr) AC_PROG_CC diff --git a/dnsclient.py b/dnsclient.py index 86e497c..76afd1f 100644 --- a/dnsclient.py +++ b/dnsclient.py @@ -349,7 +349,7 @@ def dnsParseSRV(data, base): rdata = DNSRData() format = "HHH" flen = struct.calcsize(format) - if len(rest) < flen: + if len(data) < flen: return None (rdata.priority, rdata.weight, rdata.port) = struct.unpack(format, data[:flen]) diff --git a/shvfile.py b/shvfile.py index 16aa4f5..16ac938 100644 --- a/shvfile.py +++ b/shvfile.py @@ -21,6 +21,7 @@ # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # +import os def read(filename): shv = SHVFile() @@ -98,7 +99,7 @@ class SHVFile: except OSError: return try: - self.f = os.fdopen(f, "w") + self.f = os.fdopen(fd, "w") except IOError: os.close(fd) return