From f01dad5a5140cf92c9f71fcfd6ab1c0cdb37283e Mon Sep 17 00:00:00 2001 From: fox Date: Tue, 9 Aug 2011 15:31:30 +0200 Subject: [PATCH] fixing exception for cli/wicd-cli.py --wireless -c --- cli/wicd-cli.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/cli/wicd-cli.py b/cli/wicd-cli.py index 117e1fa..8487f64 100644 --- a/cli/wicd-cli.py +++ b/cli/wicd-cli.py @@ -175,6 +175,7 @@ if options.disconnect: op_performed = True if options.connect: + check = None if options.wireless and options.network > -1: is_valid_wireless_network_id(options.network) name = wireless.GetWirelessProperty(options.network, 'essid') @@ -194,17 +195,18 @@ if options.connect: # update user on what the daemon is doing last = None - while check(): - next = message() - if next != last: - # avoid a race condition where status is updated to "done" after the - # loop check - if next == "done": - break - print "%s..." % next.replace("_", " ") - last = next - print "done!" - op_performed = True + if check is not None: + while check(): + next = message() + if next != last: + # avoid a race condition where status is updated to "done" after the + # loop check + if next == "done": + break + print "%s..." % next.replace("_", " ") + last = next + print "done!" + op_performed = True # pretty print optional and required properties def str_properties(prop):