From: James Troup Date: Mon, 22 May 2006 00:22:57 +0000 (-0500) Subject: Drop utils.str_isnum() and use string's .isdigit() method instead. X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=567c91b57f1e6af8da3e9e0ab5eeffa14796a256;p=dak.git Drop utils.str_isnum() and use string's .isdigit() method instead. --- diff --git a/ChangeLog b/ChangeLog index 905a4162..d1ea513d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-05-21 James Troup + + * dak/rm.py (main): use string .isdigit() rather than + utils.str_isnum(). + * dak/process_new.py (edit_overrides): likewise. + + * daklib/utils.py (str_isnum): removed accordingly. Also drop + string import. + 2006-05-21 James Troup * dak/check_archive.py (check_indices_files_exist): use list diff --git a/dak/process_new.py b/dak/process_new.py index 094649a5..3a1074c4 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -517,7 +517,7 @@ def edit_overrides (new): got_answer = 0 while not got_answer: answer = daklib.utils.our_raw_input(prompt) - if not daklib.utils.str_isnum(answer): + if not answer.isdigit(): answer = answer[:1].upper() if answer == "E" or answer == "D": got_answer = 1 diff --git a/dak/rm.py b/dak/rm.py index 253110a9..61b82a40 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -282,7 +282,7 @@ def main (): # carbon_copy = [] for copy_to in daklib.utils.split_args(Options.get("Carbon-Copy")): - if daklib.utils.str_isnum(copy_to): + if copy_to.isdigit(): carbon_copy.append(copy_to + "@" + Cnf["Dinstall::BugServer"]) elif copy_to == 'package': for package in arguments: diff --git a/daklib/utils.py b/daklib/utils.py index 1e182958..83b507a8 100644 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -22,7 +22,7 @@ ################################################################################ import codecs, commands, email.Header, os, pwd, re, select, socket, shutil, \ - string, sys, tempfile, traceback + sys, tempfile, traceback import apt_pkg import database @@ -97,14 +97,6 @@ def our_raw_input(prompt=""): ################################################################################ -def str_isnum (s): - for c in s: - if c not in string.digits: - return 0 - return 1 - -################################################################################ - def extract_component_from_section(section): component = ""