diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2019-08-21 01:30:00 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2019-08-21 01:36:04 +0200 |
commit | 09c24917a7f6192f0f31b7a950ad26c13573d085 (patch) | |
tree | 95f72fea0ad056277af916ff6c69329575918383 | |
parent | ed356500ff6b793a652e88ef3459d316d392bf9f (diff) | |
download | fetchmail-09c24917a7f6192f0f31b7a950ad26c13573d085.tar.gz fetchmail-09c24917a7f6192f0f31b7a950ad26c13573d085.tar.bz2 fetchmail-09c24917a7f6192f0f31b7a950ad26c13573d085.zip |
fetchmailconf: Permit editing the first item from a list, and more updates.
* Remove a bogus check that would prevent editing the first items from list boxes.
* Require Python 2.3.
* Convert apply() call to function(*(tuple,)) syntax
* string.atoi() -> int() on select[0], to continue where it's not a string
-rw-r--r-- | NEWS | 2 | ||||
-rwxr-xr-x | fetchmailconf.py | 23 |
2 files changed, 16 insertions, 9 deletions
@@ -169,6 +169,8 @@ fetchmail-6.4.0 (not yet released): of known mail. (Fix contributed by Lauri Nurmi, GitLab Merge Request !10.) * fetchmail no longer reports "System error during SSL_connect(): Success." Fixes Debian Bug#928916, reported by Paul Kimoto. +* fetchmailconf would ignore Edit or Delete actions on the first (topmost) + item in a list (no matter if server list, user list, ...). ## UPDATED TRANSLATIONS - THANKS TO: * CS: Petr Pisar <petr.pisar@atlas.cz> [Czech] diff --git a/fetchmailconf.py b/fetchmailconf.py index 1c780d4b..063e6f3d 100755 --- a/fetchmailconf.py +++ b/fetchmailconf.py @@ -11,12 +11,17 @@ # WARNING: to be compatible with Python 3, needs to be run thru 2to3.py. from __future__ import print_function -version = "1.58" +version = "1.59" + +import sys + +MIN_PY = (2,3) +if sys.version_info < MIN_PY: + sys.exit("fetchmailconf: Python %s.%s or later is required.\n" % MIN_PY); from Tkinter import * from Dialog import * - -import sys, time, os, string, socket, getopt, tempfile +import time, os, string, socket, getopt, tempfile # # Define the data structures the GUIs will be tossing around @@ -598,7 +603,7 @@ class ListEdit(Frame): self.listwidget.insert('end', item) if self.list != None: self.list.append(item) if self.editor: - apply(self.editor, (item,)) + self.editor(*(item,)) self.newval.set('') def editItem(self): @@ -606,24 +611,24 @@ class ListEdit(Frame): if not select: helpwin(listboxhelp) else: - index = select[0] - if index and self.editor: + index = int(select[0]) + if self.editor: label = self.listwidget.get(index); if self.editor: - apply(self.editor, (label,)) + self.editor(*(label,)) def deleteItem(self): select = self.listwidget.curselection() if not select: helpwin(listboxhelp) else: - index = string.atoi(select[0]) + index = int(select[0]) label = self.listwidget.get(index); self.listwidget.delete(index) if self.list != None: del self.list[index] if self.deletor != None: - apply(self.deletor, (label,)) + self.deletor(*(label,)) def ConfirmQuit(frame, context): ans = Dialog(frame, |